Skip to content
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

Supports NULL in arrays #6556

Closed
izveigor opened this issue Jun 6, 2023 · 1 comment · Fixed by #6662
Closed

Supports NULL in arrays #6556

izveigor opened this issue Jun 6, 2023 · 1 comment · Fixed by #6662
Labels
enhancement New feature or request

Comments

@izveigor
Copy link
Contributor

izveigor commented Jun 6, 2023

Is your feature request related to a problem or challenge?

Follow on to #6384

The function make_array was implemented in arrow-datafusion without supporting null elements, I think it would be better to take the concept to support NULLS in different arrays and their methods.

All methods should support this feature, especially the method array_to_string (See PR: #6384) should support null_string argument to replace NULL with it.

Describe the solution you'd like

I suggest to consider use try_new method (See https://docs.rs/arrow/latest/arrow/array/struct.PrimitiveArray.html#method.try_new)

Examples:

select make_array(NULL);
----
NULL
select make_array(1, NULL, 2, 3, NULL);
----
1 NULL 2 3 NULL
select array_to_string(make_array(1, NULL, 2, 3, NULL), ',', '*');
----
1,*,2,3,*

Describe alternatives you've considered

No response

Additional context

Simillar Issues:
#6119

Simillar PR:
#3122
#3199

@jackwener
Copy link
Member

thanks @izveigor !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants