JingsongLi commented on code in PR #10372:
URL: https://github.com/apache/paimon/pull/10372#discussion_r4177919163


##########
paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/format/canal/CanalFieldParser.java:
##########
@@ -57,7 +57,7 @@ protected static byte[] convertGeoType2WkbArray(byte[] 
mysqlGeomBytes) {
     protected static String convertSet(String value, String mysqlType) {
         // mysql set type value can be filled with more than one, value is a 
bit string conversion
         // from the long
-        int indexes = Integer.parseInt(value);
+        long indexes = Long.parseLong(value);

Review Comment:
   [P2] Parse the SET bitmap as unsigned so the 64th member is supported. MySQL 
permits 64 SET members (https://dev.mysql.com/doc/refman/8.4/en/set.html). 
Canal's RowsLogBuffer uses getUlong64 for 8-byte SET values, and 
LogBuffer.getUlong64 returns BigInteger; LogEventConvert serializes it using 
String.valueOf, so selecting member 64 produces "9223372036854775808", not a 
negative signed-long string. This new Long.parseLong still throws 
NumberFormatException for that valid event, leaving the claimed wide-SET CDC 
failure unfixed at the upper boundary. I reproduced it through 
CanalRecordParser.buildSchema with mysqlType set('c0',...,'c63') and INSERT 
data s="9223372036854775808". Replacing this call with Long.parseUnsignedLong 
makes the same event decode to [c63]; the existing >>> shift loop already 
supports the resulting bits. Please use unsigned parsing and add actual-event 
tests for bit 63 and all 64 bits. Upstream encoding: 
https://github.com/alibaba/canal/blob/master/dbsync/src/mai
 n/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java#L868 and 
https://github.com/alibaba/canal/blob/master/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L996
 .



-- 
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