Skip to content

fix ipv4_parse function return type in SQL to be bigint instead of integer#16942

Merged
gianm merged 2 commits intoapache:masterfrom
clintropolis:fix-ipv4-return-type
Aug 22, 2024
Merged

fix ipv4_parse function return type in SQL to be bigint instead of integer#16942
gianm merged 2 commits intoapache:masterfrom
clintropolis:fix-ipv4-return-type

Conversation

@clintropolis
Copy link
Member

@clintropolis clintropolis commented Aug 22, 2024

Fixes inconsistency in IPV4_PARSE function SQL return type, which prior to this PR was specified as INTEGER while the native layer uses LONG. Because of this, something like ipv4_parse('192.168.0.1') would return -1062731775 since java only has signed integers, while the long number of the native layer is 3232235521.

We could probably consider casting the negative arguments in the native layer into an int and then the bits back into a long to try to turn something like -1062731775 into 3232235521 so it isn't discarded as a null, but I didn't make that change at this time since there would be some performance cost to it, and I'm not sure if it should work anyway...

@gianm gianm merged commit 2aef6ac into apache:master Aug 22, 2024
@clintropolis clintropolis deleted the fix-ipv4-return-type branch August 22, 2024 20:37
hevansDev pushed a commit to hevansDev/druid that referenced this pull request Aug 29, 2024
…teger (apache#16942)

* fix ipv4_parse function return type in SQL to be bigint instead of integer

* fix default value mode
edgar2020 pushed a commit to edgar2020/druid that referenced this pull request Sep 5, 2024
…teger (apache#16942)

* fix ipv4_parse function return type in SQL to be bigint instead of integer

* fix default value mode
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants