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

Length-related Functions Should Return Unsigned Integer #6708

Closed
austin362667 opened this issue Nov 9, 2024 · 3 comments
Closed

Length-related Functions Should Return Unsigned Integer #6708

austin362667 opened this issue Nov 9, 2024 · 3 comments
Labels
question Further information is requested

Comments

@austin362667
Copy link
Contributor

Describe the bug

The string array functions length() and bit_length() should not return length as signed integer.

To Reproduce

See

/// Returns an array of Int32/Int64 denoting the length of each value in the array.
and
/// Returns an array of Int32/Int64 denoting the number of bits in each value in the array.

Expected behavior

Should return unsigned integer, since there are no negative length in our context.

Additional context

Thanks for @alamb bringing this up in the discussion on #6671 (comment)

Note: The actual Arrow spec uses integer types.

@tustvold tustvold added enhancement Any new improvement worthy of a entry in the changelog and removed bug labels Nov 9, 2024
@tustvold
Copy link
Contributor

tustvold commented Nov 9, 2024

I think we probably want to get some broader thoughts on this, whilst I agree unsigned is likely more appropriate in the Rust ecosystem, lots of systems, arrow included, prefer signed quantities for compatibility reasons (see StringArray, ListArray, etc...)

Either way, this isn't a bug and would be a breaking change

@alamb
Copy link
Contributor

alamb commented Nov 13, 2024

Specifically the Arrow spec uses i32/i64 typically for lengths for compatibility with Java (which does not support unsigned integers 🤷 )

@austin362667
Copy link
Contributor Author

So I think maybe we can close this issue?

@austin362667 austin362667 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
@tustvold tustvold added question Further information is requested and removed enhancement Any new improvement worthy of a entry in the changelog labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants