Skip to content

Commit e4bff75

Browse files
committed
Address comments
1 parent 7597769 commit e4bff75

File tree

15 files changed

+72
-55
lines changed

15 files changed

+72
-55
lines changed

datafusion-examples/examples/dataframe.rs

+5
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ async fn write_out(ctx: &SessionContext) -> std::result::Result<(), DataFusionEr
184184
// Ensure the column names and types match the target table
185185
df = df.with_column_renamed("column1", "tablecol1").unwrap();
186186

187+
// Support datatype cast for insert api same as insert into sql
188+
// TODO https://github.com/apache/datafusion/issues/15015
189+
df =
190+
df.with_column("tablecol1", cast(col("tablecol1"), DataType::Utf8View))?;
191+
187192
ctx.sql(
188193
"create external table
189194
test(tablecol1 varchar)

datafusion/core/tests/dataframe/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2411,6 +2411,12 @@ async fn write_table_with_order() -> Result<()> {
24112411
write_df = write_df
24122412
.with_column_renamed("column1", "tablecol1")
24132413
.unwrap();
2414+
2415+
// Support datatype cast for insert api same as insert into sql
2416+
// TODO https://github.com/apache/datafusion/issues/15015
2417+
write_df =
2418+
write_df.with_column("tablecol1", cast(col("tablecol1"), DataType::Utf8View))?;
2419+
24142420
let sql_str =
24152421
"create external table data(tablecol1 varchar) stored as parquet location '"
24162422
.to_owned()

datafusion/execution/src/config.rs

+9
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,15 @@ impl SessionConfig {
360360
self
361361
}
362362

363+
/// Returns true if the force view metadata option is enabled
364+
pub fn with_parquet_force_view_metadata(
365+
mut self,
366+
schema_force_view_types: bool,
367+
) -> Self {
368+
self.options.execution.parquet.schema_force_view_types = schema_force_view_types;
369+
self
370+
}
371+
363372
/// Returns true if page index should be used to skip parquet data pages
364373
pub fn parquet_page_index_pruning(&self) -> bool {
365374
self.options.execution.parquet.enable_page_index

datafusion/sql/src/planner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
558558
SQLDataType::Varchar(length) => {
559559
match (length, self.options.support_varchar_with_length) {
560560
(Some(_), false) => plan_err!("does not support Varchar with length, please set `support_varchar_with_length` to be true"),
561-
_ => Ok(DataType::Utf8),
561+
_ => Ok(DataType::Utf8View),
562562
}
563563
}
564564
SQLDataType::UnsignedBigInt(_) | SQLDataType::UnsignedInt8(_) => Ok(DataType::UInt64),

datafusion/sqllogictest/test_files/aggregate_skip_partial.slt

+3-6
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,11 @@ SELECT c2, approx_median(c5), approx_median(c11) FROM aggregate_test_100 GROUP B
289289
5 593204320 0.5156586
290290

291291
# Test approx_distinct for varchar / int
292-
query III
292+
query error
293293
SELECT c2, approx_distinct(c1), approx_distinct(c5) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2;
294294
----
295-
1 5 22
296-
2 5 22
297-
3 5 19
298-
4 5 23
299-
5 5 14
295+
DataFusion error: This feature is not implemented: Support for 'approx_distinct' for data type Utf8View is not implemented
296+
300297

301298
# Test count with nullable fields
302299
query III

datafusion/sqllogictest/test_files/coalesce.slt

+2-2
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ select
260260
arrow_typeof(coalesce(c, arrow_cast('b', 'Dictionary(Int32, Utf8)')))
261261
from t;
262262
----
263-
a Dictionary(Int32, Utf8)
264-
b Dictionary(Int32, Utf8)
263+
a Utf8View
264+
b Utf8View
265265

266266
statement ok
267267
drop table t;

datafusion/sqllogictest/test_files/ddl.slt

+1-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ show columns FROM table_with_pk;
819819
----
820820
datafusion public table_with_pk sn Int32 NO
821821
datafusion public table_with_pk ts Timestamp(Nanosecond, Some("+00:00")) NO
822-
datafusion public table_with_pk currency Utf8 NO
822+
datafusion public table_with_pk currency Utf8View NO
823823
datafusion public table_with_pk amount Float32 YES
824824

825825
statement ok

datafusion/sqllogictest/test_files/filter_without_sort_exec.slt

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ORDER BY "date", "time";
3434
----
3535
logical_plan
3636
01)Sort: data.date ASC NULLS LAST, data.time ASC NULLS LAST
37-
02)--Filter: data.ticker = Utf8("A")
37+
02)--Filter: data.ticker = Utf8View("A")
3838
03)----TableScan: data projection=[date, ticker, time]
3939
physical_plan
4040
01)SortPreservingMergeExec: [date@0 ASC NULLS LAST, time@2 ASC NULLS LAST]
@@ -51,7 +51,7 @@ ORDER BY "time"
5151
----
5252
logical_plan
5353
01)Sort: data.time ASC NULLS LAST
54-
02)--Filter: data.ticker = Utf8("A") AND CAST(data.time AS Date32) = data.date
54+
02)--Filter: data.ticker = Utf8View("A") AND CAST(data.time AS Date32) = data.date
5555
03)----TableScan: data projection=[date, ticker, time]
5656
physical_plan
5757
01)SortPreservingMergeExec: [time@2 ASC NULLS LAST]
@@ -68,7 +68,7 @@ ORDER BY "date"
6868
----
6969
logical_plan
7070
01)Sort: data.date ASC NULLS LAST
71-
02)--Filter: data.ticker = Utf8("A") AND CAST(data.time AS Date32) = data.date
71+
02)--Filter: data.ticker = Utf8View("A") AND CAST(data.time AS Date32) = data.date
7272
03)----TableScan: data projection=[date, ticker, time]
7373
physical_plan
7474
01)SortPreservingMergeExec: [date@0 ASC NULLS LAST]
@@ -85,7 +85,7 @@ ORDER BY "ticker"
8585
----
8686
logical_plan
8787
01)Sort: data.ticker ASC NULLS LAST
88-
02)--Filter: data.ticker = Utf8("A") AND CAST(data.time AS Date32) = data.date
88+
02)--Filter: data.ticker = Utf8View("A") AND CAST(data.time AS Date32) = data.date
8989
03)----TableScan: data projection=[date, ticker, time]
9090
physical_plan
9191
01)CoalescePartitionsExec
@@ -102,7 +102,7 @@ ORDER BY "time", "date";
102102
----
103103
logical_plan
104104
01)Sort: data.time ASC NULLS LAST, data.date ASC NULLS LAST
105-
02)--Filter: data.ticker = Utf8("A") AND CAST(data.time AS Date32) = data.date
105+
02)--Filter: data.ticker = Utf8View("A") AND CAST(data.time AS Date32) = data.date
106106
03)----TableScan: data projection=[date, ticker, time]
107107
physical_plan
108108
01)SortPreservingMergeExec: [time@2 ASC NULLS LAST, date@0 ASC NULLS LAST]
@@ -120,7 +120,7 @@ ORDER BY "time"
120120
----
121121
logical_plan
122122
01)Sort: data.time ASC NULLS LAST
123-
02)--Filter: data.ticker = Utf8("A") AND CAST(data.time AS Date32) != data.date
123+
02)--Filter: data.ticker = Utf8View("A") AND CAST(data.time AS Date32) != data.date
124124
03)----TableScan: data projection=[date, ticker, time]
125125

126126
# no relation between time & date
@@ -132,7 +132,7 @@ ORDER BY "time"
132132
----
133133
logical_plan
134134
01)Sort: data.time ASC NULLS LAST
135-
02)--Filter: data.ticker = Utf8("A")
135+
02)--Filter: data.ticker = Utf8View("A")
136136
03)----TableScan: data projection=[date, ticker, time]
137137

138138
# query

datafusion/sqllogictest/test_files/join.slt.part

+4-4
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ LEFT JOIN department AS d
820820
ON (e.name = 'Alice' OR e.name = 'Bob');
821821
----
822822
logical_plan
823-
01)Left Join: Filter: e.name = Utf8("Alice") OR e.name = Utf8("Bob")
823+
01)Left Join: Filter: e.name = Utf8View("Alice") OR e.name = Utf8View("Bob")
824824
02)--SubqueryAlias: e
825825
03)----TableScan: employees projection=[emp_id, name]
826826
04)--SubqueryAlias: d
@@ -907,7 +907,7 @@ ON (e.name = 'Alice' OR e.name = 'Bob');
907907
logical_plan
908908
01)Cross Join:
909909
02)--SubqueryAlias: e
910-
03)----Filter: employees.name = Utf8("Alice") OR employees.name = Utf8("Bob")
910+
03)----Filter: employees.name = Utf8View("Alice") OR employees.name = Utf8View("Bob")
911911
04)------TableScan: employees projection=[emp_id, name]
912912
05)--SubqueryAlias: d
913913
06)----TableScan: department projection=[dept_name]
@@ -952,11 +952,11 @@ ON e.emp_id = d.emp_id
952952
WHERE ((dept_name != 'Engineering' AND e.name = 'Alice') OR (name != 'Alice' AND e.name = 'Carol'));
953953
----
954954
logical_plan
955-
01)Filter: d.dept_name != Utf8("Engineering") AND e.name = Utf8("Alice") OR e.name != Utf8("Alice") AND e.name = Utf8("Carol")
955+
01)Filter: d.dept_name != Utf8View("Engineering") AND e.name = Utf8View("Alice") OR e.name != Utf8View("Alice") AND e.name = Utf8View("Carol")
956956
02)--Projection: e.emp_id, e.name, d.dept_name
957957
03)----Left Join: e.emp_id = d.emp_id
958958
04)------SubqueryAlias: e
959-
05)--------Filter: employees.name = Utf8("Alice") OR employees.name != Utf8("Alice") AND employees.name = Utf8("Carol")
959+
05)--------Filter: employees.name = Utf8View("Alice") OR employees.name != Utf8View("Alice") AND employees.name = Utf8View("Carol")
960960
06)----------TableScan: employees projection=[emp_id, name]
961961
07)------SubqueryAlias: d
962962
08)--------TableScan: department projection=[emp_id, dept_name]

datafusion/sqllogictest/test_files/joins.slt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1067,9 +1067,9 @@ LEFT JOIN join_t2 on join_t1.t1_id = join_t2.t2_id
10671067
WHERE join_t2.t2_int < 10 or (join_t1.t1_int > 2 and join_t2.t2_name != 'w')
10681068
----
10691069
logical_plan
1070-
01)Inner Join: join_t1.t1_id = join_t2.t2_id Filter: join_t2.t2_int < UInt32(10) OR join_t1.t1_int > UInt32(2) AND join_t2.t2_name != Utf8("w")
1070+
01)Inner Join: join_t1.t1_id = join_t2.t2_id Filter: join_t2.t2_int < UInt32(10) OR join_t1.t1_int > UInt32(2) AND join_t2.t2_name != Utf8View("w")
10711071
02)--TableScan: join_t1 projection=[t1_id, t1_name, t1_int]
1072-
03)--Filter: join_t2.t2_int < UInt32(10) OR join_t2.t2_name != Utf8("w")
1072+
03)--Filter: join_t2.t2_int < UInt32(10) OR join_t2.t2_name != Utf8View("w")
10731073
04)----TableScan: join_t2 projection=[t2_id, t2_name, t2_int]
10741074

10751075
# Reduce left join 3 (to inner join)
@@ -1153,7 +1153,7 @@ WHERE join_t1.t1_name != 'b'
11531153
----
11541154
logical_plan
11551155
01)Left Join: join_t1.t1_id = join_t2.t2_id
1156-
02)--Filter: join_t1.t1_name != Utf8("b")
1156+
02)--Filter: join_t1.t1_name != Utf8View("b")
11571157
03)----TableScan: join_t1 projection=[t1_id, t1_name, t1_int]
11581158
04)--TableScan: join_t2 projection=[t2_id, t2_name, t2_int]
11591159

@@ -1168,9 +1168,9 @@ WHERE join_t1.t1_name != 'b' and join_t2.t2_name = 'x'
11681168
----
11691169
logical_plan
11701170
01)Inner Join: join_t1.t1_id = join_t2.t2_id
1171-
02)--Filter: join_t1.t1_name != Utf8("b")
1171+
02)--Filter: join_t1.t1_name != Utf8View("b")
11721172
03)----TableScan: join_t1 projection=[t1_id, t1_name, t1_int]
1173-
04)--Filter: join_t2.t2_name = Utf8("x")
1173+
04)--Filter: join_t2.t2_name = Utf8View("x")
11741174
05)----TableScan: join_t2 projection=[t2_id, t2_name, t2_int]
11751175

11761176
###
@@ -4146,7 +4146,7 @@ logical_plan
41464146
07)------------TableScan: sales_global projection=[ts, sn, amount, currency]
41474147
08)----------SubqueryAlias: e
41484148
09)------------Projection: exchange_rates.ts, exchange_rates.currency_from, exchange_rates.rate
4149-
10)--------------Filter: exchange_rates.currency_to = Utf8("USD")
4149+
10)--------------Filter: exchange_rates.currency_to = Utf8View("USD")
41504150
11)----------------TableScan: exchange_rates projection=[ts, currency_from, currency_to, rate]
41514151
physical_plan
41524152
01)SortExec: expr=[sn@1 ASC NULLS LAST], preserve_partitioning=[false]

datafusion/sqllogictest/test_files/order.slt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1031,12 +1031,12 @@ limit 5;
10311031
----
10321032
logical_plan
10331033
01)Sort: c_str ASC NULLS LAST, fetch=5
1034-
02)--Projection: CAST(ordered_table.c AS Utf8) AS c_str
1034+
02)--Projection: CAST(ordered_table.c AS Utf8View) AS c_str
10351035
03)----TableScan: ordered_table projection=[c]
10361036
physical_plan
10371037
01)SortPreservingMergeExec: [c_str@0 ASC NULLS LAST], fetch=5
10381038
02)--SortExec: TopK(fetch=5), expr=[c_str@0 ASC NULLS LAST], preserve_partitioning=[true]
1039-
03)----ProjectionExec: expr=[CAST(c@0 AS Utf8) as c_str]
1039+
03)----ProjectionExec: expr=[CAST(c@0 AS Utf8View) as c_str]
10401040
04)------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
10411041
05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_2.csv]]}, projection=[c], output_ordering=[c@0 ASC NULLS LAST], file_type=csv, has_header=true
10421042

datafusion/sqllogictest/test_files/parquet_filter_pushdown.slt

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ EXPLAIN select b from t_pushdown where a = 'bar' order by b;
144144
----
145145
logical_plan
146146
01)Sort: t_pushdown.b ASC NULLS LAST
147-
02)--TableScan: t_pushdown projection=[b], full_filters=[t_pushdown.a = Utf8("bar")]
147+
02)--TableScan: t_pushdown projection=[b], full_filters=[t_pushdown.a = Utf8View("bar")]
148148
physical_plan
149149
01)SortPreservingMergeExec: [b@0 ASC NULLS LAST]
150150
02)--SortExec: expr=[b@0 ASC NULLS LAST], preserve_partitioning=[true]

datafusion/sqllogictest/test_files/struct.slt

+15-15
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ select * from struct_values;
5353
query TT
5454
select arrow_typeof(s1), arrow_typeof(s2) from struct_values;
5555
----
56-
Struct([Field { name: "c0", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) Struct([Field { name: "a", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
57-
Struct([Field { name: "c0", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) Struct([Field { name: "a", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
58-
Struct([Field { name: "c0", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) Struct([Field { name: "a", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
56+
Struct([Field { name: "c0", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) Struct([Field { name: "a", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
57+
Struct([Field { name: "c0", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) Struct([Field { name: "a", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
58+
Struct([Field { name: "c0", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) Struct([Field { name: "a", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
5959

6060

6161
# struct[i]
@@ -392,7 +392,7 @@ create table t(a struct<r varchar, c int>, b struct<r varchar, c float>) as valu
392392
query T
393393
select arrow_typeof([a, b]) from t;
394394
----
395-
List(Field { name: "item", data_type: Struct([Field { name: "r", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "c", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} })
395+
List(Field { name: "item", data_type: Struct([Field { name: "r", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "c", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} })
396396

397397
query ?
398398
select [a, b] from t;
@@ -443,12 +443,12 @@ select * from t;
443443
query T
444444
select arrow_typeof(c1) from t;
445445
----
446-
Struct([Field { name: "r", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
446+
Struct([Field { name: "r", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
447447

448448
query T
449449
select arrow_typeof(c2) from t;
450450
----
451-
Struct([Field { name: "r", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
451+
Struct([Field { name: "r", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
452452

453453
statement ok
454454
drop table t;
@@ -498,9 +498,9 @@ select coalesce(s1) from t;
498498
query T
499499
select arrow_typeof(coalesce(s1, s2)) from t;
500500
----
501-
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
502-
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
503-
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
501+
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
502+
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
503+
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
504504

505505
statement ok
506506
drop table t;
@@ -525,9 +525,9 @@ select coalesce(s1, s2) from t;
525525
query T
526526
select arrow_typeof(coalesce(s1, s2)) from t;
527527
----
528-
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
529-
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
530-
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
528+
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
529+
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
530+
Struct([Field { name: "a", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "b", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
531531

532532
statement ok
533533
drop table t;
@@ -562,7 +562,7 @@ create table t(a struct(r varchar, c int), b struct(r varchar, c float)) as valu
562562
query T
563563
select arrow_typeof([a, b]) from t;
564564
----
565-
List(Field { name: "item", data_type: Struct([Field { name: "r", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "c", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} })
565+
List(Field { name: "item", data_type: Struct([Field { name: "r", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "c", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} })
566566

567567
statement ok
568568
drop table t;
@@ -585,13 +585,13 @@ create table t(a struct(r varchar, c int, g float), b struct(r varchar, c float,
585585
query T
586586
select arrow_typeof(a) from t;
587587
----
588-
Struct([Field { name: "r", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "c", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "g", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
588+
Struct([Field { name: "r", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "c", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "g", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
589589

590590
# type of each column should not coerced but perserve as it is
591591
query T
592592
select arrow_typeof(b) from t;
593593
----
594-
Struct([Field { name: "r", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "c", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "g", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
594+
Struct([Field { name: "r", data_type: Utf8View, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "c", data_type: Float32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "g", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])
595595

596596
statement ok
597597
drop table t;

0 commit comments

Comments
 (0)