From 2d8f6d4ad0500c7383db0b080efe37804d9bc7a0 Mon Sep 17 00:00:00 2001 From: James Cor Date: Mon, 10 Feb 2025 15:50:05 -0800 Subject: [PATCH] move status messages from parquet to stderr (#8842) --- go/cmd/dolt/cli/stdio.go | 2 +- go/cmd/dolt/commands/sql.go | 2 +- integration-tests/bats/sql.bats | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/go/cmd/dolt/cli/stdio.go b/go/cmd/dolt/cli/stdio.go index 601ffd4c9a..eb12870b33 100644 --- a/go/cmd/dolt/cli/stdio.go +++ b/go/cmd/dolt/cli/stdio.go @@ -176,7 +176,7 @@ func DeleteAndPrint(prevMsgLen int, msg string) int { } } - Print(string(backspacesAndMsg)) + PrintErr(string(backspacesAndMsg)) return msgLen } diff --git a/go/cmd/dolt/commands/sql.go b/go/cmd/dolt/commands/sql.go index 914141da16..4e8d251d37 100644 --- a/go/cmd/dolt/commands/sql.go +++ b/go/cmd/dolt/commands/sql.go @@ -1240,7 +1240,7 @@ func (f *fileReadProgress) printNewLineIfNeeded() { func updateFileReadProgressOutput() { if fileReadProg == nil { // this should not happen, but sanity check - cli.Println("No file is being processed.") + cli.PrintErrln("No file is being processed.") } // batch can be writing to the line, so print new line. batchEditStats.printNewLineIfNeeded() diff --git a/integration-tests/bats/sql.bats b/integration-tests/bats/sql.bats index 65815f7774..395a4cedf3 100755 --- a/integration-tests/bats/sql.bats +++ b/integration-tests/bats/sql.bats @@ -1054,6 +1054,30 @@ SQL [ "${#lines[@]}" -eq 0 ] } +@test "sql: parquet file output separates output and status messages" { + dolt sql < in.sql + + dolt sql -r parquet -f in.sql > out.parquet 2> out.txt + + run cat out.parquet + [ $status -eq 0 ] + [[ ! "$output" =~ "Processed" ]] || false + + run cat out.txt + [ "$status" -eq 0 ] + [[ "$output" =~ "Processed" ]] || false +} + @test "sql: output for escaped longtext exports properly" { dolt sql <