-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support empty array for array_union
, array_intersect
, and array_except
#8181
Comments
FYI. I have tried these functions locally, I find that these functions can handle empty arrays but not ❯ select array_union(make_array([]), make_array([]));
+--------------------------------------------------------------------------------+
| array_union(make_array(List([NullArray(0)])),make_array(List([NullArray(0)]))) |
+--------------------------------------------------------------------------------+
| [] |
+--------------------------------------------------------------------------------+
1 row in set. Query took 0.002 seconds.
❯ select array_intersect(make_array([]), make_array([]));
+------------------------------------------------------------------------------------+
| array_intersect(make_array(List([NullArray(0)])),make_array(List([NullArray(0)]))) |
+------------------------------------------------------------------------------------+
| [] |
+------------------------------------------------------------------------------------+
1 row in set. Query took 0.002 seconds.
❯ select array_except(make_array([]), make_array([]));
+---------------------------------------------------------------------------------+
| array_except(make_array(List([NullArray(0)])),make_array(List([NullArray(0)]))) |
+---------------------------------------------------------------------------------+
| [] |
+---------------------------------------------------------------------------------+
1 row in set. Query took 0.002 seconds. but if we just use ❯ select [];
+----------------------+
| List([NullArray(0)]) |
+----------------------+
+----------------------+
0 rows in set. Query took 0.001 seconds. In fact, we can not distinguish |
I'm trying to fix this |
If we can reuse |
how about behaviors like below: for
for
for
|
Is your feature request related to a problem or challenge?
We cant deal with empty array for these three array function
Result
Expected
Describe the solution you'd like
Able to deal with empty array
Describe alternatives you've considered
None
Additional context
IIRC empty array has been an issue for long, we can't differentiate it from null array, so I think this issue is not only for these three array functions. I had traced this issue before but ends up nothing and work on other tasks, if anyone is interesting, welcome to pick it up.
The text was updated successfully, but these errors were encountered: