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

IPPrefix compatibility with Velox #12070

Open
yuandagits opened this issue Jan 13, 2025 · 1 comment
Open

IPPrefix compatibility with Velox #12070

yuandagits opened this issue Jan 13, 2025 · 1 comment
Labels
bug Something isn't working triage Newly created issue that needs attention.

Comments

@yuandagits
Copy link
Contributor

Bug description

This query will reproduce IPPrefix compatibility issue: "
  | encoding == kindEncoding Serialized encoding is not compatible with requested type: ROW. Expected ROW. Got VARIABLE_WIDTH."

SELECT   CAST(ip AS ipprefix) BETWEEN ipprefix '1.2.0.0/24' 
      AND ipprefix '1.2.3.4/32' is_ipv4, CAST(ip AS ipprefix) as casted_ip  FROM (
    VALUES
        (1, '1.2.0.0/24')
) AS t (id, ip);

The reason is because IPPrefix in Java is implemented as a slice of 17 bytes with the first 16 bytes stored as a big endian binary, and the last byte as the prefix length.

In Velox, IPPrefix is stored a ROW<IPAddress, TINYINT>, which means that there is a mismatch in the de-serialization and serialization when we get/sent data from/to Java.

System information

n/a

Relevant logs

No response

@yuandagits yuandagits added bug Something isn't working triage Newly created issue that needs attention. labels Jan 13, 2025
@yuandagits
Copy link
Contributor Author

cc @amitkdutta @mohsaka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Newly created issue that needs attention.
Projects
None yet
Development

No branches or pull requests

1 participant