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

fix wrong error variable used #4206

Merged
merged 3 commits into from Aug 30, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/libraries/doltcore/table/typed/parquet/reader.go
Expand Up @@ -74,7 +74,7 @@ func NewParquetReader(vrw types.ValueReadWriter, fr source.ParquetFile, sche sch
for _, col := range columns {
colData, _, _, cErr := pr.ReadColumnByPath(common.ReformPathStr(fmt.Sprintf("parquet_go_root.%s", col.Name)), num)
if cErr != nil {
return nil, err
return nil, fmt.Errorf("cannot read column: %s", cErr.Error())
}
data[col.Name] = colData
colName = append(colName, col.Name)
Expand Down
8 changes: 8 additions & 0 deletions integration-tests/bats/import-update-tables.bats
Expand Up @@ -445,6 +445,14 @@ DELIM
[[ "$output" = "" ]] || false
}

@test "import-update-tables: bad parquet file import errors" {
dolt sql -q "CREATE TABLE test_table (pk int primary key, col1 text, col2 int);"
echo "This is a bad parquet file" > bad.parquet
run dolt table import -u test_table bad.parquet
[ "$status" -eq 1 ]
[[ "$output" =~ "When attempting to move data from parquet file:bad.parquet to test_table, could not open a reader." ]] || false
}

@test "import-update-tables: Subsequent updates with --continue correctly work" {
dolt sql -q "create table t (pk int primary key, val varchar(1))"
cat <<DELIM > file1.csv
Expand Down