Skip to content

Commit e833914

Browse files
committed
Merge remote-tracking branch 'apache/main' into alamb/sliding_udf_real
2 parents 579b4d9 + 6872535 commit e833914

File tree

9 files changed

+181
-218
lines changed

9 files changed

+181
-218
lines changed

datafusion/common/src/dfschema.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@ impl DFSchema {
384384
let self_fields = self.fields().iter();
385385
let other_fields = other.fields().iter();
386386
self_fields.zip(other_fields).all(|(f1, f2)| {
387-
f1.qualifier() == f2.qualifier()
388-
&& f1.name() == f2.name()
387+
// TODO: resolve field when exist alias
388+
// f1.qualifier() == f2.qualifier()
389+
// && f1.name() == f2.name()
390+
// column(t1.a) field is "t1"."a"
391+
// column(x) as t1.a field is ""."t1.a"
392+
f1.qualified_name() == f2.qualified_name()
389393
&& Self::datatype_is_semantically_equal(f1.data_type(), f2.data_type())
390394
})
391395
}

datafusion/core/tests/dataframe.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use datafusion::{assert_batches_eq, assert_batches_sorted_eq};
3737
use datafusion_common::{DataFusionError, ScalarValue};
3838
use datafusion_execution::config::SessionConfig;
3939
use datafusion_expr::expr::{GroupingSet, Sort};
40-
use datafusion_expr::utils::COUNT_STAR_EXPANSION;
4140
use datafusion_expr::Expr::Wildcard;
4241
use datafusion_expr::{
4342
avg, col, count, exists, expr, in_subquery, lit, max, out_ref_col, scalar_subquery,
@@ -234,7 +233,7 @@ async fn test_count_wildcard_on_where_scalar_subquery() -> Result<()> {
234233

235234
// In the same SessionContext, AliasGenerator will increase subquery_alias id by 1
236235
// https://github.com/apache/arrow-datafusion/blame/cf45eb9020092943b96653d70fafb143cc362e19/datafusion/optimizer/src/alias.rs#L40-L43
237-
// for compare difference betwwen sql and df logical plan, we need to create a new SessionContext here
236+
// for compare difference between sql and df logical plan, we need to create a new SessionContext here
238237
let ctx = create_join_context()?;
239238
let df_results = ctx
240239
.table("t1")
@@ -244,8 +243,8 @@ async fn test_count_wildcard_on_where_scalar_subquery() -> Result<()> {
244243
ctx.table("t2")
245244
.await?
246245
.filter(out_ref_col(DataType::UInt32, "t1.a").eq(col("t2.a")))?
247-
.aggregate(vec![], vec![count(lit(COUNT_STAR_EXPANSION))])?
248-
.select(vec![count(lit(COUNT_STAR_EXPANSION))])?
246+
.aggregate(vec![], vec![count(Wildcard)])?
247+
.select(vec![col(count(Wildcard).to_string())])?
249248
.into_unoptimized_plan(),
250249
))
251250
.gt(lit(ScalarValue::UInt8(Some(0)))),
@@ -267,7 +266,7 @@ async fn test_count_wildcard_on_where_scalar_subquery() -> Result<()> {
267266
#[tokio::test]
268267
async fn describe() -> Result<()> {
269268
let ctx = SessionContext::new();
270-
let testdata = datafusion::test_util::parquet_test_data();
269+
let testdata = parquet_test_data();
271270
ctx.register_parquet(
272271
"alltypes_tiny_pages",
273272
&format!("{testdata}/alltypes_tiny_pages.parquet"),

datafusion/core/tests/sql/expr.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,15 +512,22 @@ async fn test_regex_expressions() -> Result<()> {
512512

513513
#[tokio::test]
514514
async fn test_cast_expressions() -> Result<()> {
515+
test_expression!("CAST('0' AS INT)", "0");
516+
test_expression!("CAST(NULL AS INT)", "NULL");
517+
test_expression!("TRY_CAST('0' AS INT)", "0");
518+
test_expression!("TRY_CAST('x' AS INT)", "NULL");
519+
Ok(())
520+
}
521+
522+
#[tokio::test]
523+
#[ignore]
524+
// issue: https://github.com/apache/arrow-datafusion/issues/6596
525+
async fn test_array_cast_expressions() -> Result<()> {
515526
test_expression!("CAST([1,2,3,4] AS INT[])", "[1, 2, 3, 4]");
516527
test_expression!(
517528
"CAST([1,2,3,4] AS NUMERIC(10,4)[])",
518529
"[1.0000, 2.0000, 3.0000, 4.0000]"
519530
);
520-
test_expression!("CAST('0' AS INT)", "0");
521-
test_expression!("CAST(NULL AS INT)", "NULL");
522-
test_expression!("TRY_CAST('0' AS INT)", "0");
523-
test_expression!("TRY_CAST('x' AS INT)", "NULL");
524531
Ok(())
525532
}
526533

datafusion/core/tests/sqllogictests/test_files/array.slt

Lines changed: 78 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,18 @@ select make_array(make_array()), make_array(make_array(make_array()))
6161
----
6262
[[]] [[[]]]
6363

64+
# TODO issue: https://github.com/apache/arrow-datafusion/issues/6596
6465
# array_append scalar function #1
65-
query ? rowsort
66+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
67+
caused by
68+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
6669
select array_append(make_array(), 4);
67-
----
68-
[4]
6970

7071
# array_append scalar function #2
71-
query ?? rowsort
72+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
73+
caused by
74+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
7275
select array_append(make_array(), make_array()), array_append(make_array(), make_array(4));
73-
----
74-
[[]] [[4]]
7576

7677
# array_append scalar function #3
7778
query ??? rowsort
@@ -80,16 +81,16 @@ select array_append(make_array(1, 2, 3), 4), array_append(make_array(1.0, 2.0, 3
8081
[1, 2, 3, 4] [1.0, 2.0, 3.0, 4.0] [h, e, l, l, o]
8182

8283
# array_prepend scalar function #1
83-
query ? rowsort
84+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
85+
caused by
86+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
8487
select array_prepend(4, make_array());
85-
----
86-
[4]
8788

8889
# array_prepend scalar function #2
89-
query ?? rowsort
90+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
91+
caused by
92+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
9093
select array_prepend(make_array(), make_array()), array_prepend(make_array(4), make_array());
91-
----
92-
[[]] [[4]]
9394

9495
# array_prepend scalar function #3
9596
query ??? rowsort
@@ -98,22 +99,22 @@ select array_prepend(1, make_array(2, 3, 4)), array_prepend(1.0, make_array(2.0,
9899
[1, 2, 3, 4] [1.0, 2.0, 3.0, 4.0] [h, e, l, l, o]
99100

100101
# array_fill scalar function #1
101-
query ??? rowsort
102+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
103+
caused by
104+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
102105
select array_fill(11, make_array(1, 2, 3)), array_fill(3, make_array(2, 3)), array_fill(2, make_array(2));
103-
----
104-
[[[11, 11, 11], [11, 11, 11]]] [[3, 3, 3], [3, 3, 3]] [2, 2]
105106

106107
# array_fill scalar function #2
107-
query ?? rowsort
108+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
109+
caused by
110+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
108111
select array_fill(1, make_array(1, 1, 1)), array_fill(2, make_array(2, 2, 2, 2, 2));
109-
----
110-
[[[1]]] [[[[[2, 2], [2, 2]], [[2, 2], [2, 2]]], [[[2, 2], [2, 2]], [[2, 2], [2, 2]]]], [[[[2, 2], [2, 2]], [[2, 2], [2, 2]]], [[[2, 2], [2, 2]], [[2, 2], [2, 2]]]]]
111112

112113
# array_fill scalar function #3
113-
query ?
114+
query error DataFusion error: SQL error: TokenizerError\("Unterminated string literal at Line: 2, Column 856"\)
115+
caused by
116+
Internal error: Optimizer rule 'simplify_expressions' failed, due to generate a different schema, original schema: DFSchema \{ fields: \[DFField \{ qualifier: None, field: Field \{ name: "array_fill\(Int64\(1\),make_array\(\)\)", data_type: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \} \}\], metadata: \{\} \}, new schema: DFSchema \{ fields: \[DFField \{ qualifier: None, field: Field \{ name: "array_fill\(Int64\(1\),make_array\(\)\)", data_type: List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: \{\} \} \}\], metadata: \{\} \}\. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
114117
select array_fill(1, make_array())
115-
----
116-
[]
117118

118119
# array_concat scalar function #1
119120
query ?? rowsort
@@ -146,10 +147,10 @@ select array_concat(make_array(2, 3), make_array());
146147
[2, 3]
147148

148149
# array_concat scalar function #6
149-
query ? rowsort
150+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
151+
caused by
152+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
150153
select array_concat(make_array(), make_array(2, 3));
151-
----
152-
[2, 3]
153154

154155
# array_position scalar function #1
155156
query III
@@ -164,10 +165,10 @@ select array_position(['h', 'e', 'l', 'l', 'o'], 'l', 4), array_position([1, 2,
164165
4 5 2
165166

166167
# array_positions scalar function
167-
query III
168+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
169+
caused by
170+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: UInt8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to UInt8
168171
select array_positions(['h', 'e', 'l', 'l', 'o'], 'l'), array_positions([1, 2, 3, 4, 5], 5), array_positions([1, 1, 1], 1);
169-
----
170-
[3, 4] [5] [1, 2, 3]
171172

172173
# array_replace scalar function
173174
query ???
@@ -176,22 +177,22 @@ select array_replace(make_array(1, 2, 3, 4), 2, 3), array_replace(make_array(1,
176177
[1, 3, 3, 4] [1, 0, 0, 5, 0, 6, 7] [1, 2, 3]
177178

178179
# array_to_string scalar function
179-
query ???
180+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
181+
caused by
182+
Arrow error: Cast error: Cannot cast string '1\-2\-3\-4\-5' to value of Int64 type
180183
select array_to_string(['h', 'e', 'l', 'l', 'o'], ','), array_to_string([1, 2, 3, 4, 5], '-'), array_to_string([1.0, 2.0, 3.0], '|');
181-
----
182-
h,e,l,l,o 1-2-3-4-5 1|2|3
183184

184185
# array_to_string scalar function #2
185-
query ???
186+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
187+
caused by
188+
Arrow error: Cast error: Cannot cast string '1\+2\+3\+4\+5\+6' to value of Int64 type
186189
select array_to_string([1, 1, 1], '1'), array_to_string([[1, 2], [3, 4], [5, 6]], '+'), array_to_string(array_fill(3, [3, 2, 2]), '/\');
187-
----
188-
11111 1+2+3+4+5+6 3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3
189190

190191
# array_to_string scalar function #3
191-
query ?
192+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
193+
caused by
194+
Error during planning: Cannot automatically convert Utf8 to List\(Field \{ name: "item", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
192195
select array_to_string(make_array(), ',')
193-
----
194-
(empty)
195196

196197
# cardinality scalar function
197198
query III
@@ -200,10 +201,10 @@ select cardinality(make_array(1, 2, 3, 4, 5)), cardinality([1, 3, 5]), cardinali
200201
5 3 5
201202

202203
# cardinality scalar function #2
203-
query II
204+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
205+
caused by
206+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
204207
select cardinality(make_array([1, 2], [3, 4], [5, 6])), cardinality(array_fill(3, array[3, 2, 3]));
205-
----
206-
6 18
207208

208209
# cardinality scalar function #3
209210
query II
@@ -218,10 +219,10 @@ select trim_array(make_array(1, 2, 3, 4, 5), 2), trim_array(['h', 'e', 'l', 'l',
218219
[1, 2, 3] [h, e] [1.0]
219220

220221
# trim_array scalar function #2
221-
query ??
222+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
223+
caused by
224+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
222225
select trim_array([[1, 2], [3, 4], [5, 6]], 2), trim_array(array_fill(4, [3, 4, 2]), 2);
223-
----
224-
[[1, 2]] [[[4, 4], [4, 4], [4, 4], [4, 4]]]
225226

226227
# trim_array scalar function #3
227228
query ?
@@ -254,10 +255,10 @@ select array_length(make_array(1, 2, 3, 4, 5), 2), array_length(make_array(1, 2,
254255
NULL NULL 2
255256

256257
# array_length scalar function #4
257-
query IIII rowsort
258+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
259+
caused by
260+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
258261
select array_length(array_fill(3, [3, 2, 5]), 1), array_length(array_fill(3, [3, 2, 5]), 2), array_length(array_fill(3, [3, 2, 5]), 3), array_length(array_fill(3, [3, 2, 5]), 4);
259-
----
260-
3 2 5 NULL
261262

262263
# array_length scalar function #5
263264
query III rowsort
@@ -266,22 +267,22 @@ select array_length(make_array()), array_length(make_array(), 1), array_length(m
266267
0 0 NULL
267268

268269
# array_dims scalar function
269-
query III rowsort
270+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
271+
caused by
272+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: UInt8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to UInt8
270273
select array_dims(make_array(1, 2, 3)), array_dims(make_array([1, 2], [3, 4])), array_dims(make_array([[[[1], [2]]]]));
271-
----
272-
[3] [2, 2] [1, 1, 1, 2, 1]
273274

274275
# array_dims scalar function #2
275-
query II rowsort
276+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
277+
caused by
278+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
276279
select array_dims(array_fill(2, [1, 2, 3])), array_dims(array_fill(3, [2, 5, 4]));
277-
----
278-
[1, 2, 3] [2, 5, 4]
279280

280281
# array_dims scalar function #3
281-
query II rowsort
282+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
283+
caused by
284+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: UInt8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to UInt8
282285
select array_dims(make_array()), array_dims(make_array(make_array()))
283-
----
284-
[0] [1, 0]
285286

286287
# array_ndims scalar function
287288
query III rowsort
@@ -290,17 +291,37 @@ select array_ndims(make_array(1, 2, 3)), array_ndims(make_array([1, 2], [3, 4]))
290291
1 2 5
291292

292293
# array_ndims scalar function #2
293-
query II rowsort
294+
query error DataFusion error: SQL error: ParserError\("Expected an SQL statement, found: caused"\)
295+
caused by
296+
Error during planning: Cannot automatically convert List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) to List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
294297
select array_ndims(array_fill(1, [1, 2, 3])), array_ndims([[[[[[[[[[[[[[[[[[[[[1]]]]]]]]]]]]]]]]]]]]]);
295-
----
296-
3 21
297298

298299
# array_ndims scalar function #3
299300
query II rowsort
300301
select array_ndims(make_array()), array_ndims(make_array(make_array()))
301302
----
302303
1 2
303304

305+
# array concatenate operator #1 (like array_concat scalar function)
306+
query ?? rowsort
307+
select make_array(1, 2, 3) || make_array(4, 5, 6) || make_array(7, 8, 9), make_array([1], [2]) || make_array([3], [4]);
308+
----
309+
[1, 2, 3, 4, 5, 6, 7, 8, 9] [[1], [2], [3], [4]]
310+
311+
# array concatenate operator #2 (like array_append scalar function)
312+
query ??? rowsort
313+
select make_array(1, 2, 3) || 4, make_array(1.0, 2.0, 3.0) || 4.0, make_array('h', 'e', 'l', 'l') || 'o';
314+
----
315+
[1, 2, 3, 4] [1.0, 2.0, 3.0, 4.0] [h, e, l, l, o]
316+
317+
# array concatenate operator #3 (like array_prepend scalar function)
318+
query ??? rowsort
319+
select 1 || make_array(2, 3, 4), 1.0 || make_array(2.0, 3.0, 4.0), 'h' || make_array('e', 'l', 'l', 'o');
320+
----
321+
[1, 2, 3, 4] [1.0, 2.0, 3.0, 4.0] [h, e, l, l, o]
322+
323+
# make_array
324+
304325
query ?
305326
select make_array(1, 2.0)
306327
----

datafusion/expr/src/type_coercion/binary.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ fn string_concat_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option<Da
673673
(LargeUtf8, from_type) | (from_type, LargeUtf8) => {
674674
string_concat_internal_coercion(from_type, &LargeUtf8)
675675
}
676+
// TODO: cast between array elements (#6558)
677+
(List(_), from_type) | (from_type, List(_)) => Some(from_type.to_owned()),
676678
_ => None,
677679
})
678680
}
@@ -697,6 +699,10 @@ fn string_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option<DataType>
697699
(LargeUtf8, Utf8) => Some(LargeUtf8),
698700
(Utf8, LargeUtf8) => Some(LargeUtf8),
699701
(LargeUtf8, LargeUtf8) => Some(LargeUtf8),
702+
// TODO: cast between array elements (#6558)
703+
(List(_), List(_)) => Some(lhs_type.clone()),
704+
(List(_), _) => Some(lhs_type.clone()),
705+
(_, List(_)) => Some(rhs_type.clone()),
700706
_ => None,
701707
}
702708
}

0 commit comments

Comments
 (0)