-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: load parquet with missing_field_as get wrong results.
- Loading branch information
1 parent
dabea9f
commit 522b49a
Showing
9 changed files
with
87 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 46 additions & 27 deletions
73
tests/sqllogictests/suites/stage/formats/parquet/options/parquet_missing_field.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,57 @@ | ||
statement ok | ||
drop table if exists c1234 | ||
drop table if exists t1 | ||
|
||
statement ok | ||
create table c1234 (c1 int, c2 int, c3 int64, c4 string default 'ok') | ||
create table t1 (c1 int, c2 int, c3 int64, c4 string default 'ok') | ||
|
||
query | ||
select * from infer_schema(location => '@data/parquet/diff_schema/f1.parquet') | ||
---- | ||
c1 BIGINT 1 0 | ||
c2 SMALLINT 1 1 | ||
c3 BIGINT 1 2 | ||
|
||
query | ||
select * from infer_schema(location => '@data/parquet/diff_schema/f2.parquet') | ||
---- | ||
c6 BIGINT 1 0 | ||
c5 BIGINT 1 1 | ||
c2 BIGINT 1 2 | ||
c4 VARCHAR 1 3 | ||
|
||
query error get diff schema | ||
copy into c1234 from @data/parquet/diff_schema/ file_format=(type=parquet) pattern='.*[.]parquet' | ||
copy into t1 from @data/parquet/diff_schema/ file_format=(type=parquet) pattern='.*[.]parquet' | ||
|
||
query | ||
copy into t1 from @data/parquet/diff_schema/ file_format=(type=parquet missing_field_as='field_default') pattern='.*[.]parquet' | ||
---- | ||
parquet/diff_schema/f1.parquet 10 0 NULL NULL | ||
parquet/diff_schema/f2.parquet 10 0 NULL NULL | ||
|
||
query | ||
copy into c1234 from @data/parquet/diff_schema/ file_format=(type=parquet missing_field_as='field_default') pattern='.*[.]parquet' | ||
select * from t1 order by c1,c2,c3,c4 | ||
---- | ||
parquet/diff_schema/c1c2c3.parquet 10 0 NULL NULL | ||
parquet/diff_schema/c2c3c4.parquet 10 0 NULL NULL | ||
110 120 130 ok | ||
111 121 131 ok | ||
112 122 132 ok | ||
113 123 133 ok | ||
114 124 134 ok | ||
115 125 135 ok | ||
116 126 136 ok | ||
117 127 137 ok | ||
118 128 138 ok | ||
119 129 139 ok | ||
NULL 220 NULL 240 | ||
NULL 221 NULL 241 | ||
NULL 222 NULL 242 | ||
NULL 223 NULL 243 | ||
NULL 224 NULL 244 | ||
NULL 225 NULL 245 | ||
NULL 226 NULL 246 | ||
NULL 227 NULL 247 | ||
NULL 228 NULL 248 | ||
NULL 229 NULL 249 | ||
|
||
query | ||
select * from c1234 order by c1,c2,c3,c4 | ||
copy into t1 from @data/parquet/diff_schema/ file_format=(type=parquet missing_field_as='field_default') pattern='.*[.]parquet' | ||
---- | ||
1 2 3 ok | ||
2 3 4 ok | ||
3 4 5 ok | ||
4 5 6 ok | ||
5 6 7 ok | ||
6 7 8 ok | ||
7 8 9 ok | ||
8 9 10 ok | ||
9 10 11 ok | ||
10 11 12 ok | ||
NULL 12 13 14 | ||
NULL 13 14 15 | ||
NULL 14 15 16 | ||
NULL 15 16 17 | ||
NULL 16 17 18 | ||
NULL 17 18 19 | ||
NULL 18 19 20 | ||
NULL 19 20 21 | ||
NULL 20 21 22 | ||
NULL 21 22 23 |