Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move status messages from parquet to stderr #8842

Merged
merged 9 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/cmd/dolt/cli/stdio.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func DeleteAndPrint(prevMsgLen int, msg string) int {
}
}

Print(string(backspacesAndMsg))
PrintErr(string(backspacesAndMsg))
return msgLen
}

Expand Down
2 changes: 1 addition & 1 deletion go/cmd/dolt/commands/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
24 changes: 24 additions & 0 deletions integration-tests/bats/sql.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Loading