Myracle commented on PR #27483:
URL: https://github.com/apache/flink/pull/27483#issuecomment-3889151917

   @lincoln-lil Thanks for the suggestion! I evaluated using 
com.google.common.net.InetAddresses and sun.net.util.IPAddressUtil, but decided 
to keep the custom implementation for the following reasons:
   1. MySQL short-form IP compatibility: Guava's InetAddresses.forString() does 
not support MySQL-compatible short-form IP addresses (e.g., "127.1" interpreted 
as "127.0.0.1").
   2. Leading zeros handling: Standard IP parsers may interpret leading zeros 
as octal (e.g., "010" → 8), while MySQL treats them as decimal ("010" → 10). 
Our implementation follows MySQL behavior.
   3. JDK internal API concerns: As you mentioned, sun.net.util.IPAddressUtil 
requires --add-exports, which introduces JDK version compatibility issues.
   
   I've added detailed Implementation Note in the Javadoc for both 
InetAtonFunction and InetNtoaFunction to document these design decisions for 
future maintainers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to