We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
array_repeat
How array_repeat works currently for null as input in array or key:
null
> SELECT array_repeat(null,0 ) AS repeated_array; +----------------+ | repeated_array | +----------------+ | [] | +----------------+ 1 row(s) fetched. Elapsed 0.006 seconds. > SELECT array_repeat(null,1 ) AS repeated_array; +----------------+ | repeated_array | +----------------+ | [] | +----------------+ 1 row(s) fetched. Elapsed 0.002 seconds. > SELECT array_repeat(null,2 ) AS repeated_array; +----------------+ | repeated_array | +----------------+ | [, ] | +----------------+ 1 row(s) fetched. Elapsed 0.004 seconds. > SELECT array_repeat(ARRAY[1, 2], null) AS repeated_array; Internal error: could not cast value to arrow_array::array::primitive_array::PrimitiveArray<arrow_array::types::Int64Type>. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
> SELECT ARRAY_LENGTH(array_repeat(null, 0)); +-------------------------------------------+ | array_length(array_repeat(NULL,Int64(0))) | +-------------------------------------------+ | 0 | +-------------------------------------------+ 1 row(s) fetched. Elapsed 0.006 seconds. > SELECT ARRAY_LENGTH(array_repeat(null, 1)); +-------------------------------------------+ | array_length(array_repeat(NULL,Int64(1))) | +-------------------------------------------+ | 1 | +-------------------------------------------+
No response
The text was updated successfully, but these errors were encountered:
empty array [] and array of null with len = 1 [] looks the same but they are different, since we don't output null
[]
SELECT array_repeat(ARRAY[1, 2], null)
I think we can return null for this case
Sorry, something went wrong.
This will be a breaking change. @jayzhan211 cc: @alamb
No branches or pull requests
Describe the bug
How
array_repeat
works currently fornull
as input in array or key:but above both look same ?
To Reproduce
No response
Expected behavior
No response
Additional context
The text was updated successfully, but these errors were encountered: