From fe5bd053eb97ee731a7cb8d3d4789aa406059cbb Mon Sep 17 00:00:00 2001 From: my-vegetable-has-exploded Date: Sun, 19 Nov 2023 20:55:10 +0800 Subject: [PATCH] fix proto&slt. --- datafusion/proto/proto/datafusion.proto | 1 + datafusion/proto/src/generated/pbjson.rs | 4 +++- datafusion/proto/src/generated/prost.rs | 6 +++--- datafusion/sqllogictest/test_files/array.slt | 16 ++++++++-------- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/datafusion/proto/proto/datafusion.proto b/datafusion/proto/proto/datafusion.proto index 9d508078c705b..4bc25283fbb5a 100644 --- a/datafusion/proto/proto/datafusion.proto +++ b/datafusion/proto/proto/datafusion.proto @@ -641,6 +641,7 @@ enum ScalarFunction { ArrayExcept = 123; ArrayPopFront = 124; Levenshtein = 125; + ArrayDistinct = 126; } message ScalarFunctionNode { diff --git a/datafusion/proto/src/generated/pbjson.rs b/datafusion/proto/src/generated/pbjson.rs index 53dd62b2d4682..5e4409ad8c61d 100644 --- a/datafusion/proto/src/generated/pbjson.rs +++ b/datafusion/proto/src/generated/pbjson.rs @@ -20812,7 +20812,6 @@ impl serde::Serialize for ScalarFunction { Self::ArrayAppend => "ArrayAppend", Self::ArrayConcat => "ArrayConcat", Self::ArrayDims => "ArrayDims", - Self::ArrayDistinct => "ArrayDistinct", Self::ArrayRepeat => "ArrayRepeat", Self::ArrayLength => "ArrayLength", Self::ArrayNdims => "ArrayNdims", @@ -20850,6 +20849,7 @@ impl serde::Serialize for ScalarFunction { Self::ArrayExcept => "ArrayExcept", Self::ArrayPopFront => "ArrayPopFront", Self::Levenshtein => "Levenshtein", + Self::ArrayDistinct => "ArrayDistinct", }; serializer.serialize_str(variant) } @@ -20987,6 +20987,7 @@ impl<'de> serde::Deserialize<'de> for ScalarFunction { "ArrayExcept", "ArrayPopFront", "Levenshtein", + "ArrayDistinct", ]; struct GeneratedVisitor; @@ -21153,6 +21154,7 @@ impl<'de> serde::Deserialize<'de> for ScalarFunction { "ArrayExcept" => Ok(ScalarFunction::ArrayExcept), "ArrayPopFront" => Ok(ScalarFunction::ArrayPopFront), "Levenshtein" => Ok(ScalarFunction::Levenshtein), + "ArrayDistinct" => Ok(ScalarFunction::ArrayDistinct), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } diff --git a/datafusion/proto/src/generated/prost.rs b/datafusion/proto/src/generated/prost.rs index ad687a23f839f..eb4a9b68b4088 100644 --- a/datafusion/proto/src/generated/prost.rs +++ b/datafusion/proto/src/generated/prost.rs @@ -2572,7 +2572,7 @@ pub enum ScalarFunction { ArrayExcept = 123, ArrayPopFront = 124, Levenshtein = 125, - ArrayDistinct = 126, + ArrayDistinct = 126, } impl ScalarFunction { /// String value of the enum field names used in the ProtoBuf definition. @@ -2670,7 +2670,6 @@ impl ScalarFunction { ScalarFunction::ArrayAppend => "ArrayAppend", ScalarFunction::ArrayConcat => "ArrayConcat", ScalarFunction::ArrayDims => "ArrayDims", - ScalarFunction::ArrayDistinct => "ArrayDistinct", ScalarFunction::ArrayRepeat => "ArrayRepeat", ScalarFunction::ArrayLength => "ArrayLength", ScalarFunction::ArrayNdims => "ArrayNdims", @@ -2708,6 +2707,7 @@ impl ScalarFunction { ScalarFunction::ArrayExcept => "ArrayExcept", ScalarFunction::ArrayPopFront => "ArrayPopFront", ScalarFunction::Levenshtein => "Levenshtein", + ScalarFunction::ArrayDistinct => "ArrayDistinct", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2802,7 +2802,6 @@ impl ScalarFunction { "ArrayAppend" => Some(Self::ArrayAppend), "ArrayConcat" => Some(Self::ArrayConcat), "ArrayDims" => Some(Self::ArrayDims), - "ArrayDistinct" => Some(Self::ArrayDistinct), "ArrayRepeat" => Some(Self::ArrayRepeat), "ArrayLength" => Some(Self::ArrayLength), "ArrayNdims" => Some(Self::ArrayNdims), @@ -2840,6 +2839,7 @@ impl ScalarFunction { "ArrayExcept" => Some(Self::ArrayExcept), "ArrayPopFront" => Some(Self::ArrayPopFront), "Levenshtein" => Some(Self::Levenshtein), + "ArrayDistinct" => Some(Self::ArrayDistinct), _ => None, } } diff --git a/datafusion/sqllogictest/test_files/array.slt b/datafusion/sqllogictest/test_files/array.slt index a3cdd69671302..3b17f34d101ad 100644 --- a/datafusion/sqllogictest/test_files/array.slt +++ b/datafusion/sqllogictest/test_files/array.slt @@ -186,7 +186,7 @@ statement ok CREATE TABLE array_distinct_table_1D AS VALUES (make_array(1, 1, 2, 2, 3)), - (make_array(1, 2, 3, 4, 5)) + (make_array(1, 2, 3, 4, 5)), (make_array(3, 5, 3, 3, 3)) ; @@ -194,15 +194,15 @@ statement ok CREATE TABLE array_distinct_table_1D_UTF8 AS VALUES (make_array('a', 'a', 'bc', 'bc', 'def')), - (make_array('a', 'bc', 'def', 'defg', 'defg')) + (make_array('a', 'bc', 'def', 'defg', 'defg')), (make_array('defg', 'defg', 'defg', 'defg', 'defg')) ; statement ok -CREATE TABLE array_distinct_table_2D_ +CREATE TABLE array_distinct_table_2D AS VALUES (make_array([1,2], [1,2], [3,4], [3,4], [5,6])), - (make_array([1,2], [3,4], [5,6], [7,8], [9,10])) + (make_array([1,2], [3,4], [5,6], [7,8], [9,10])), (make_array([5,6], [5,6], NULL)) ; @@ -2642,7 +2642,7 @@ select array_has_all(make_array(1,2,3), make_array(1,3)), ---- true false true false false false true true false false true false true -query ??? +query ? select array_distinct(column1) from array_distinct_table_1D; ---- @@ -2650,7 +2650,7 @@ from array_distinct_table_1D; [1, 2, 3, 4, 5] [3, 5] -query ??? +query ? select array_distinct(column1) from array_distinct_table_1D_UTF8; ---- @@ -2658,13 +2658,13 @@ from array_distinct_table_1D_UTF8; [a, bc, def, defg] [defg] -query ??? +query ? select array_distinct(column1) from array_distinct_table_2D; ---- [[1, 2], [3, 4], [5, 6]] [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] -[[5, 6], NULL] +[, [5, 6]] query ??? select array_intersect(column1, column2),