samuelcolvin commented on code in PR #11896:
URL: https://github.com/apache/datafusion/pull/11896#discussion_r1710452950
##########
datafusion/sqllogictest/test_files/struct.slt:
##########
@@ -236,3 +233,44 @@ query ?
select {'animal': {'cat': 1, 'dog': 2, 'bird': {'parrot': 3, 'canary': 1}},
'genre': {'fiction': ['mystery', 'sci-fi', 'fantasy'], 'non-fiction':
{'biography': 5, 'history': 7, 'science': {'physics': 2, 'biology': 3}}},
'vehicle': {'car': {'sedan': 4, 'suv': 2}, 'bicycle': 3, 'boat': ['sailboat',
'motorboat']}, 'weather': {'sunny': True, 'temperature': 25.5, 'wind':
{'speed': 10, 'direction': 'NW'}}};
----
{animal: {cat: 1, dog: 2, bird: {parrot: 3, canary: 1}}, genre: {fiction:
[mystery, sci-fi, fantasy], non-fiction: {biography: 5, history: 7, science:
{physics: 2, biology: 3}}}, vehicle: {car: {sedan: 4, suv: 2}, bicycle: 3,
boat: [sailboat, motorboat]}, weather: {sunny: true, temperature: 25.5, wind:
{speed: 10, direction: NW}}}
+
+# test tuple as struct
+query B
+select ('x', 'y') = ('x', 'y');
+----
+true
+
+query B
+select ('x', 'y') = ('y', 'x');
+----
+false
+
+query error DataFusion error: Error during planning: Cannot infer common
argument type for comparison operation Struct.*
+select ('x', 'y') = ('x', 'y', 'z');
+
+query B
+select ('x', 'y') IN (('x', 'y'));
+----
+true
+
+query B
+select ('x', 'y') IN (('x', 'y'), ('y', 'x'));
+----
+true
+
+query I
+select a from values where (a, c) = (1, 'a');
+----
+1
+
+query I
+select a from values where (a, c) IN ((1, 'a'), (2, 'b'));
Review Comment:
this will fail
##########
datafusion/sqllogictest/test_files/struct.slt:
##########
@@ -236,3 +233,44 @@ query ?
select {'animal': {'cat': 1, 'dog': 2, 'bird': {'parrot': 3, 'canary': 1}},
'genre': {'fiction': ['mystery', 'sci-fi', 'fantasy'], 'non-fiction':
{'biography': 5, 'history': 7, 'science': {'physics': 2, 'biology': 3}}},
'vehicle': {'car': {'sedan': 4, 'suv': 2}, 'bicycle': 3, 'boat': ['sailboat',
'motorboat']}, 'weather': {'sunny': True, 'temperature': 25.5, 'wind':
{'speed': 10, 'direction': 'NW'}}};
----
{animal: {cat: 1, dog: 2, bird: {parrot: 3, canary: 1}}, genre: {fiction:
[mystery, sci-fi, fantasy], non-fiction: {biography: 5, history: 7, science:
{physics: 2, biology: 3}}}, vehicle: {car: {sedan: 4, suv: 2}, bicycle: 3,
boat: [sailboat, motorboat]}, weather: {sunny: true, temperature: 25.5, wind:
{speed: 10, direction: NW}}}
+
+# test tuple as struct
+query B
+select ('x', 'y') = ('x', 'y');
+----
+true
+
+query B
+select ('x', 'y') = ('y', 'x');
+----
+false
+
+query error DataFusion error: Error during planning: Cannot infer common
argument type for comparison operation Struct.*
+select ('x', 'y') = ('x', 'y', 'z');
+
+query B
+select ('x', 'y') IN (('x', 'y'));
+----
+true
+
+query B
+select ('x', 'y') IN (('x', 'y'), ('y', 'x'));
Review Comment:
this will fail
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]