From f7b66f6461e56a2b28260afe3031e8dabc6a572d Mon Sep 17 00:00:00 2001 From: Dharan Aditya Date: Mon, 19 Aug 2024 19:12:04 +0530 Subject: [PATCH 1/9] naive impl --- .../expr-common/src/type_coercion/binary.rs | 23 ++++++---------- .../physical-expr/src/expressions/binary.rs | 26 ++++++++++++++++++- .../src/expressions/binary/kernels.rs | 20 ++++++++++++++ .../sqllogictest/test_files/string_view.slt | 15 +++++------ 4 files changed, 60 insertions(+), 24 deletions(-) diff --git a/datafusion/expr-common/src/type_coercion/binary.rs b/datafusion/expr-common/src/type_coercion/binary.rs index 6d2fb660f669..ab77c04268c0 100644 --- a/datafusion/expr-common/src/type_coercion/binary.rs +++ b/datafusion/expr-common/src/type_coercion/binary.rs @@ -916,22 +916,15 @@ fn dictionary_coercion( /// 2. Data type of the other side should be able to cast to string type fn string_concat_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option { use arrow::datatypes::DataType::*; - match (lhs_type, rhs_type) { - // If Utf8View is in any side, we coerce to Utf8. - // Ref: https://github.com/apache/datafusion/pull/11796 - (Utf8View, Utf8View | Utf8 | LargeUtf8) | (Utf8 | LargeUtf8, Utf8View) => { - Some(Utf8) + string_coercion(lhs_type, rhs_type).or(match (lhs_type, rhs_type) { + (Utf8, from_type) | (from_type, Utf8) => { + string_concat_internal_coercion(from_type, &Utf8) } - _ => string_coercion(lhs_type, rhs_type).or(match (lhs_type, rhs_type) { - (Utf8, from_type) | (from_type, Utf8) => { - string_concat_internal_coercion(from_type, &Utf8) - } - (LargeUtf8, from_type) | (from_type, LargeUtf8) => { - string_concat_internal_coercion(from_type, &LargeUtf8) - } - _ => None, - }), - } + (LargeUtf8, from_type) | (from_type, LargeUtf8) => { + string_concat_internal_coercion(from_type, &LargeUtf8) + } + _ => None, + }) } fn array_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option { diff --git a/datafusion/physical-expr/src/expressions/binary.rs b/datafusion/physical-expr/src/expressions/binary.rs index 26885ae1350c..e73197402be7 100644 --- a/datafusion/physical-expr/src/expressions/binary.rs +++ b/datafusion/physical-expr/src/expressions/binary.rs @@ -41,6 +41,7 @@ use datafusion_expr::type_coercion::binary::get_result_type; use datafusion_expr::{ColumnarValue, Operator}; use datafusion_physical_expr_common::datum::{apply, apply_cmp, apply_cmp_for_nested}; +use crate::expressions::binary::kernels::concat_elements_utf8view; use kernels::{ bitwise_and_dyn, bitwise_and_dyn_scalar, bitwise_or_dyn, bitwise_or_dyn_scalar, bitwise_shift_left_dyn, bitwise_shift_left_dyn_scalar, bitwise_shift_right_dyn, @@ -662,7 +663,8 @@ impl BinaryExpr { BitwiseXor => bitwise_xor_dyn(left, right), BitwiseShiftRight => bitwise_shift_right_dyn(left, right), BitwiseShiftLeft => bitwise_shift_left_dyn(left, right), - StringConcat => binary_string_array_op!(left, right, concat_elements), + // StringConcat => binary_string_array_op!(left, right, concat_elements), // FIXME: Can we remove binary_string_array_op + StringConcat => concat_elements(left, right), AtArrow | ArrowAt => { unreachable!("ArrowAt and AtArrow should be rewritten to function") } @@ -670,6 +672,28 @@ impl BinaryExpr { } } +fn concat_elements(left: Arc, right: Arc) -> Result { + Ok(match left.data_type() { + DataType::Utf8 => Arc::new(concat_elements_utf8( + left.as_string::(), + right.as_string::(), + )?), + DataType::LargeUtf8 => Arc::new(concat_elements_utf8( + left.as_string::(), + right.as_string::(), + )?), + DataType::Utf8View => Arc::new(concat_elements_utf8view( + left.as_string_view(), + right.as_string_view(), + )?), + other => { + return internal_err!( + "Data type {other:?} not supported for binary operation 'concat_elements' on string arrays" + ); + } + }) +} + /// Create a binary expression whose arguments are correctly coerced. /// This function errors if it is not possible to coerce the arguments /// to computational types supported by the operator. diff --git a/datafusion/physical-expr/src/expressions/binary/kernels.rs b/datafusion/physical-expr/src/expressions/binary/kernels.rs index b0736e140fec..f4e94bc7354a 100644 --- a/datafusion/physical-expr/src/expressions/binary/kernels.rs +++ b/datafusion/physical-expr/src/expressions/binary/kernels.rs @@ -27,6 +27,7 @@ use arrow::datatypes::DataType; use datafusion_common::internal_err; use datafusion_common::{Result, ScalarValue}; +use arrow_schema::ArrowError; use std::sync::Arc; /// Downcasts $LEFT and $RIGHT to $ARRAY_TYPE and then calls $KERNEL($LEFT, $RIGHT) @@ -131,3 +132,22 @@ create_dyn_scalar_kernel!(bitwise_or_dyn_scalar, bitwise_or_scalar); create_dyn_scalar_kernel!(bitwise_xor_dyn_scalar, bitwise_xor_scalar); create_dyn_scalar_kernel!(bitwise_shift_right_dyn_scalar, bitwise_shift_right_scalar); create_dyn_scalar_kernel!(bitwise_shift_left_dyn_scalar, bitwise_shift_left_scalar); + +pub fn concat_elements_utf8view( + left: &StringViewArray, + right: &StringViewArray, +) -> std::result::Result { + let mut result = StringViewBuilder::new(); + for (l, r) in left.iter().zip(right.iter()) { + match (l, r) { + (None, None) => { + result.append_null(); + } + _ => { + let concat_val = format!("{}{}", l.unwrap_or(""), r.unwrap_or("")); + result.append_value(concat_val); + } + } + } + Ok(result.finish()) +} diff --git a/datafusion/sqllogictest/test_files/string_view.slt b/datafusion/sqllogictest/test_files/string_view.slt index 82a714a432ba..1c542b741589 100644 --- a/datafusion/sqllogictest/test_files/string_view.slt +++ b/datafusion/sqllogictest/test_files/string_view.slt @@ -1164,14 +1164,13 @@ create table temp as values ('value1', arrow_cast('rust', 'Utf8View'), arrow_cast('fast', 'Utf8View')), ('value2', arrow_cast('datafusion', 'Utf8View'), arrow_cast('cool', 'Utf8View')); -query T +query ? select column2||' is fast' from temp; ---- rust is fast datafusion is fast - -query T +query ? select column2 || ' is ' || column3 from temp; ---- rust is fast @@ -1181,7 +1180,7 @@ query TT explain select column2 || 'is' || column3 from temp; ---- logical_plan -01)Projection: CAST(temp.column2 AS Utf8) || Utf8("is") || CAST(temp.column3 AS Utf8) +01)Projection: temp.column2 || Utf8View("is") || temp.column3 AS temp.column2 || Utf8("is") || temp.column3 02)--TableScan: temp projection=[column2, column3] @@ -1189,11 +1188,11 @@ query TT explain select column2||' is fast' from temp; ---- logical_plan -01)Projection: CAST(temp.column2 AS Utf8) || Utf8(" is fast") +01)Projection: temp.column2 || Utf8View(" is fast") AS temp.column2 || Utf8(" is fast") 02)--TableScan: temp projection=[column2] -query T +query ? select column2||column3 from temp; ---- rustfast @@ -1203,10 +1202,10 @@ query TT explain select column2||column3 from temp; ---- logical_plan -01)Projection: CAST(temp.column2 AS Utf8) || CAST(temp.column3 AS Utf8) +01)Projection: temp.column2 || temp.column3 02)--TableScan: temp projection=[column2, column3] -query T +query ? select column2|| ' ' ||column3 from temp; ---- rust fast From 588f75d5d3077ed0381edd7011f55be286459152 Mon Sep 17 00:00:00 2001 From: Dharan Aditya Date: Tue, 20 Aug 2024 22:20:23 +0530 Subject: [PATCH 2/9] calc capacity --- .../physical-expr/src/expressions/binary.rs | 28 ------------------- .../src/expressions/binary/kernels.rs | 19 +++++++------ 2 files changed, 11 insertions(+), 36 deletions(-) diff --git a/datafusion/physical-expr/src/expressions/binary.rs b/datafusion/physical-expr/src/expressions/binary.rs index e73197402be7..b1c29f296cba 100644 --- a/datafusion/physical-expr/src/expressions/binary.rs +++ b/datafusion/physical-expr/src/expressions/binary.rs @@ -132,34 +132,6 @@ impl std::fmt::Display for BinaryExpr { } } -/// Invoke a compute kernel on a pair of binary data arrays -macro_rules! compute_utf8_op { - ($LEFT:expr, $RIGHT:expr, $OP:ident, $DT:ident) => {{ - let ll = $LEFT - .as_any() - .downcast_ref::<$DT>() - .expect("compute_op failed to downcast left side array"); - let rr = $RIGHT - .as_any() - .downcast_ref::<$DT>() - .expect("compute_op failed to downcast right side array"); - Ok(Arc::new(paste::expr! {[<$OP _utf8>]}(&ll, &rr)?)) - }}; -} - -macro_rules! binary_string_array_op { - ($LEFT:expr, $RIGHT:expr, $OP:ident) => {{ - match $LEFT.data_type() { - DataType::Utf8 => compute_utf8_op!($LEFT, $RIGHT, $OP, StringArray), - DataType::LargeUtf8 => compute_utf8_op!($LEFT, $RIGHT, $OP, LargeStringArray), - other => internal_err!( - "Data type {:?} not supported for binary operation '{}' on string arrays", - other, stringify!($OP) - ), - } - }}; -} - /// Invoke a boolean kernel on a pair of arrays macro_rules! boolean_op { ($LEFT:expr, $RIGHT:expr, $OP:ident) => {{ diff --git a/datafusion/physical-expr/src/expressions/binary/kernels.rs b/datafusion/physical-expr/src/expressions/binary/kernels.rs index f4e94bc7354a..7ac3e6167a83 100644 --- a/datafusion/physical-expr/src/expressions/binary/kernels.rs +++ b/datafusion/physical-expr/src/expressions/binary/kernels.rs @@ -137,15 +137,18 @@ pub fn concat_elements_utf8view( left: &StringViewArray, right: &StringViewArray, ) -> std::result::Result { - let mut result = StringViewBuilder::new(); - for (l, r) in left.iter().zip(right.iter()) { - match (l, r) { - (None, None) => { - result.append_null(); - } + let capacity = left + .data_buffers() + .iter() + .zip(right.data_buffers().iter()) + .map(|(b1, b2)| b1.len() + b2.len()) + .sum(); + let mut result = StringViewBuilder::with_capacity(capacity); + for (left, right) in left.iter().zip(right.iter()) { + match (left, right) { + (None, None) => result.append_null(), _ => { - let concat_val = format!("{}{}", l.unwrap_or(""), r.unwrap_or("")); - result.append_value(concat_val); + result.append_value(left.unwrap_or("").to_string() + right.unwrap_or("")) } } } From d4bac1e6ce1845d83dec5945bc6b364e036aa3c8 Mon Sep 17 00:00:00 2001 From: Dharan Aditya Date: Tue, 20 Aug 2024 22:21:03 +0530 Subject: [PATCH 3/9] cleanup --- datafusion/physical-expr/src/expressions/binary.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/datafusion/physical-expr/src/expressions/binary.rs b/datafusion/physical-expr/src/expressions/binary.rs index b1c29f296cba..b663d8614275 100644 --- a/datafusion/physical-expr/src/expressions/binary.rs +++ b/datafusion/physical-expr/src/expressions/binary.rs @@ -635,7 +635,6 @@ impl BinaryExpr { BitwiseXor => bitwise_xor_dyn(left, right), BitwiseShiftRight => bitwise_shift_right_dyn(left, right), BitwiseShiftLeft => bitwise_shift_left_dyn(left, right), - // StringConcat => binary_string_array_op!(left, right, concat_elements), // FIXME: Can we remove binary_string_array_op StringConcat => concat_elements(left, right), AtArrow | ArrowAt => { unreachable!("ArrowAt and AtArrow should be rewritten to function") From 2d584676f807cecdef478571ec3c29ca90aa87e2 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 21 Aug 2024 14:01:05 -0400 Subject: [PATCH 4/9] Update test --- datafusion/sqllogictest/test_files/string_view.slt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datafusion/sqllogictest/test_files/string_view.slt b/datafusion/sqllogictest/test_files/string_view.slt index 7cf47fc23b1c..cf337dba35fe 100644 --- a/datafusion/sqllogictest/test_files/string_view.slt +++ b/datafusion/sqllogictest/test_files/string_view.slt @@ -1173,13 +1173,13 @@ create table temp as values ('value1', arrow_cast('rust', 'Utf8View'), arrow_cast('fast', 'Utf8View')), ('value2', arrow_cast('datafusion', 'Utf8View'), arrow_cast('cool', 'Utf8View')); -query ? +query T select column2||' is fast' from temp; ---- rust is fast datafusion is fast -query ? +query T select column2 || ' is ' || column3 from temp; ---- rust is fast @@ -1201,7 +1201,7 @@ logical_plan 02)--TableScan: temp projection=[column2] -query ? +query T select column2||column3 from temp; ---- rustfast @@ -1214,7 +1214,7 @@ logical_plan 01)Projection: temp.column2 || temp.column3 02)--TableScan: temp projection=[column2, column3] -query ? +query T select column2|| ' ' ||column3 from temp; ---- rust fast From a7848fce5386e215c8fc4e0003493f3bf6da1481 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 21 Aug 2024 14:06:23 -0400 Subject: [PATCH 5/9] simplify coercion logic --- datafusion/expr-common/src/type_coercion/binary.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/datafusion/expr-common/src/type_coercion/binary.rs b/datafusion/expr-common/src/type_coercion/binary.rs index ab77c04268c0..b60b0635cf15 100644 --- a/datafusion/expr-common/src/type_coercion/binary.rs +++ b/datafusion/expr-common/src/type_coercion/binary.rs @@ -912,11 +912,14 @@ fn dictionary_coercion( /// Coercion rules for string concat. /// This is a union of string coercion rules and specified rules: -/// 1. At lease one side of lhs and rhs should be string type (Utf8 / LargeUtf8) +/// 1. At least one side of lhs and rhs should be string type (Utf8 / LargeUtf8) /// 2. Data type of the other side should be able to cast to string type fn string_concat_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option { use arrow::datatypes::DataType::*; string_coercion(lhs_type, rhs_type).or(match (lhs_type, rhs_type) { + (Utf8View, from_type) | (from_type, Utf8View) => { + string_concat_internal_coercion(from_type, &Utf8View) + } (Utf8, from_type) | (from_type, Utf8) => { string_concat_internal_coercion(from_type, &Utf8) } @@ -935,6 +938,8 @@ fn array_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option } } +/// If `from_type` can be casted to `to_type`, return `to_type`, otherwise +/// return `None`. fn string_concat_internal_coercion( from_type: &DataType, to_type: &DataType, @@ -960,6 +965,7 @@ fn string_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option } // Then, if LargeUtf8 is in any side, we coerce to LargeUtf8. (LargeUtf8, Utf8 | LargeUtf8) | (Utf8, LargeUtf8) => Some(LargeUtf8), + // Utf8 coerces to Utf8 (Utf8, Utf8) => Some(Utf8), _ => None, } From ef31f356b7126a72edcdb98f51c2b30cbb1b26a7 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 21 Aug 2024 14:20:24 -0400 Subject: [PATCH 6/9] write some more tests --- .../sqllogictest/test_files/string_view.slt | 62 ++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/datafusion/sqllogictest/test_files/string_view.slt b/datafusion/sqllogictest/test_files/string_view.slt index cf337dba35fe..b07b306a71db 100644 --- a/datafusion/sqllogictest/test_files/string_view.slt +++ b/datafusion/sqllogictest/test_files/string_view.slt @@ -1145,6 +1145,58 @@ FROM test; 0 NULL +# || mixed types +query TTTTTTTT +SELECT + column1_utf8view || column2_utf8view, + column1_utf8 || column2_utf8view, + column1_large_utf8 || column2_utf8view, + column1_dict || column2_utf8view, + -- reverse argument order + column2_utf8view || column1_utf8view, + column2_utf8view || column1_utf8, + column2_utf8view || column1_large_utf8, + column2_utf8view || column1_dict +FROM test; +---- +AndrewX AndrewX AndrewX AndrewX XAndrew XAndrew XAndrew XAndrew +XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng +RaphaelR RaphaelR RaphaelR RaphaelR RRaphael RRaphael RRaphael RRaphael +R R R R R R R R + +# || constants +query TTTTTTTT +SELECT + column1_utf8view || 'foo', + column1_utf8 || 'foo', + column1_large_utf8 || 'foo', + column1_dict || 'foo', + -- reverse argument order + 'foo' || column1_utf8view, + 'foo' || column1_utf8, + 'foo' || column1_large_utf8, + 'foo' || column1_dict +FROM test; +---- +Andrewfoo Andrewfoo Andrewfoo Andrewfoo fooAndrew fooAndrew fooAndrew fooAndrew +Xiangpengfoo Xiangpengfoo Xiangpengfoo Xiangpengfoo fooXiangpeng fooXiangpeng fooXiangpeng fooXiangpeng +Raphaelfoo Raphaelfoo Raphaelfoo Raphaelfoo fooRaphael fooRaphael fooRaphael fooRaphael +foo NULL NULL NULL foo NULL NULL NULL + + + + +# || same type (column1 has null, so also tests NULL || NULL) +query error DataFusion error: Error during planning: Cannot infer common string type for string concat operation Dictionary\(Int32, Utf8\) \|\| Dictionary\(Int32, Utf8\) +SELECT + column1_utf8view || column1_utf8view, + column1_utf8 || column1_utf8, + column1_large_utf8 || column1_large_utf8, + column1_dict || column1_dict +FROM test; + + + statement ok drop table test; @@ -1168,11 +1220,19 @@ select t.dt from dates t where arrow_cast('2024-01-01', 'Utf8View') < t.dt; statement ok drop table dates; +### Tests for `||` with Utf8View specifically + statement ok create table temp as values ('value1', arrow_cast('rust', 'Utf8View'), arrow_cast('fast', 'Utf8View')), ('value2', arrow_cast('datafusion', 'Utf8View'), arrow_cast('cool', 'Utf8View')); +query TTT +select arrow_typeof(column1), arrow_typeof(column2), arrow_typeof(column3) from temp; +---- +Utf8 Utf8View Utf8View +Utf8 Utf8View Utf8View + query T select column2||' is fast' from temp; ---- @@ -1192,7 +1252,7 @@ logical_plan 01)Projection: temp.column2 || Utf8View("is") || temp.column3 AS temp.column2 || Utf8("is") || temp.column3 02)--TableScan: temp projection=[column2, column3] - +# should not cast the column2 to utf8 query TT explain select column2||' is fast' from temp; ---- From cc32d5efbc7d16121eaee4026dafca7ceaadb7e5 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 21 Aug 2024 14:25:54 -0400 Subject: [PATCH 7/9] Update tests --- datafusion/sqllogictest/test_files/string_view.slt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/datafusion/sqllogictest/test_files/string_view.slt b/datafusion/sqllogictest/test_files/string_view.slt index b07b306a71db..d5744c4b4a89 100644 --- a/datafusion/sqllogictest/test_files/string_view.slt +++ b/datafusion/sqllogictest/test_files/string_view.slt @@ -1187,13 +1187,19 @@ foo NULL NULL NULL foo NULL NULL NULL # || same type (column1 has null, so also tests NULL || NULL) -query error DataFusion error: Error during planning: Cannot infer common string type for string concat operation Dictionary\(Int32, Utf8\) \|\| Dictionary\(Int32, Utf8\) +query TTT SELECT column1_utf8view || column1_utf8view, column1_utf8 || column1_utf8, - column1_large_utf8 || column1_large_utf8, - column1_dict || column1_dict + column1_large_utf8 || column1_large_utf8 + -- TODO file ticket for dict || dict + --column1_dict || column1_dict FROM test; +---- +AndrewAndrew AndrewAndrew AndrewAndrew +XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng +RaphaelRaphael RaphaelRaphael RaphaelRaphael +NULL NULL NULL From 90d2122c82b65b8e1792343eaa6e1ba652894368 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 21 Aug 2024 14:30:31 -0400 Subject: [PATCH 8/9] Improve implementation and do the right thing for null --- .../src/expressions/binary/kernels.rs | 20 ++++++++++++++----- .../sqllogictest/test_files/string_view.slt | 12 +++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/datafusion/physical-expr/src/expressions/binary/kernels.rs b/datafusion/physical-expr/src/expressions/binary/kernels.rs index 7ac3e6167a83..1f9cfed1a44f 100644 --- a/datafusion/physical-expr/src/expressions/binary/kernels.rs +++ b/datafusion/physical-expr/src/expressions/binary/kernels.rs @@ -144,12 +144,22 @@ pub fn concat_elements_utf8view( .map(|(b1, b2)| b1.len() + b2.len()) .sum(); let mut result = StringViewBuilder::with_capacity(capacity); + + // Avoid reallocations by writing to a reused buffer (note we + // could be even more efficient r by creating the view directly + // here and avoid the buffer but that would be more complex) + let mut buffer = String::new(); + for (left, right) in left.iter().zip(right.iter()) { - match (left, right) { - (None, None) => result.append_null(), - _ => { - result.append_value(left.unwrap_or("").to_string() + right.unwrap_or("")) - } + if let (Some(left), Some(right)) = (left, right) { + use std::fmt::Write; + buffer.clear(); + write!(&mut buffer, "{left}{right}") + .expect("writing into string buffer failed"); + result.append_value(&buffer); + } else { + // at least one of the values is null, so the output is also null + result.append_null() } } Ok(result.finish()) diff --git a/datafusion/sqllogictest/test_files/string_view.slt b/datafusion/sqllogictest/test_files/string_view.slt index d5744c4b4a89..3967bb4f57a0 100644 --- a/datafusion/sqllogictest/test_files/string_view.slt +++ b/datafusion/sqllogictest/test_files/string_view.slt @@ -1146,6 +1146,7 @@ FROM test; NULL # || mixed types +# expect all results to be the same for each row as they all have the same values query TTTTTTTT SELECT column1_utf8view || column2_utf8view, @@ -1162,9 +1163,10 @@ FROM test; AndrewX AndrewX AndrewX AndrewX XAndrew XAndrew XAndrew XAndrew XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng RaphaelR RaphaelR RaphaelR RaphaelR RRaphael RRaphael RRaphael RRaphael -R R R R R R R R +NULL NULL NULL NULL NULL NULL NULL NULL # || constants +# expect all results to be the same for each row as they all have the same values query TTTTTTTT SELECT column1_utf8view || 'foo', @@ -1181,12 +1183,10 @@ FROM test; Andrewfoo Andrewfoo Andrewfoo Andrewfoo fooAndrew fooAndrew fooAndrew fooAndrew Xiangpengfoo Xiangpengfoo Xiangpengfoo Xiangpengfoo fooXiangpeng fooXiangpeng fooXiangpeng fooXiangpeng Raphaelfoo Raphaelfoo Raphaelfoo Raphaelfoo fooRaphael fooRaphael fooRaphael fooRaphael -foo NULL NULL NULL foo NULL NULL NULL - - - +NULL NULL NULL NULL NULL NULL NULL NULL # || same type (column1 has null, so also tests NULL || NULL) +# expect all results to be the same for each row as they all have the same values query TTT SELECT column1_utf8view || column1_utf8view, @@ -1201,8 +1201,6 @@ XiangpengXiangpeng XiangpengXiangpeng XiangpengXiangpeng RaphaelRaphael RaphaelRaphael RaphaelRaphael NULL NULL NULL - - statement ok drop table test; From 20a65f7258b088833b68851004ad9a74de7c1247 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 21 Aug 2024 14:47:22 -0400 Subject: [PATCH 9/9] add ticket reference --- datafusion/sqllogictest/test_files/string_view.slt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datafusion/sqllogictest/test_files/string_view.slt b/datafusion/sqllogictest/test_files/string_view.slt index 3967bb4f57a0..96ca212a513e 100644 --- a/datafusion/sqllogictest/test_files/string_view.slt +++ b/datafusion/sqllogictest/test_files/string_view.slt @@ -1192,7 +1192,8 @@ SELECT column1_utf8view || column1_utf8view, column1_utf8 || column1_utf8, column1_large_utf8 || column1_large_utf8 - -- TODO file ticket for dict || dict + -- Dictionary/Dictionary coercion doesn't work + -- https://github.com/apache/datafusion/issues/12101 --column1_dict || column1_dict FROM test; ----