move status messages from parquet to stderr (#8842)

This commit is contained in:
James Cor
2025-02-10 15:50:05 -08:00
committed by GitHub
parent 5a3735c558
commit 2d8f6d4ad0
3 changed files with 26 additions and 2 deletions

View File

@@ -176,7 +176,7 @@ func DeleteAndPrint(prevMsgLen int, msg string) int {
}
}
Print(string(backspacesAndMsg))
PrintErr(string(backspacesAndMsg))
return msgLen
}

View File

@@ -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()

View File

@@ -1054,6 +1054,30 @@ SQL
[ "${#lines[@]}" -eq 0 ]
}
@test "sql: parquet file output separates output and status messages" {
dolt sql <<SQL
CREATE TABLE test (
a int primary key,
b float,
c varchar(80),
d datetime
);
insert into test values (1, 1.5, "1", "2020-01-01");
SQL
echo "select * from test;" > 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 <<SQL
CREATE TABLE test (