You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "zhangjun0x01 (via GitHub)" <gi...@apache.org> on 2023/05/04 14:13:37 UTC

[GitHub] [incubator-paimon] zhangjun0x01 opened a new pull request, #1065: [flink] add set type for mysql cdc action

zhangjun0x01 opened a new pull request, #1065:
URL: https://github.com/apache/incubator-paimon/pull/1065

   *(Please specify the module before the PR name: [core] ... or [flink] ...)*
   
   ### Purpose
   
   *related to https://github.com/apache/incubator-paimon/issues/966 *
   
   ### Tests
   
   * org.apache.paimon.flink.action.cdc.mysql.MySqlSyncTableActionITCase *
   
   ### API and Format 
   
   *(Does this change affect API or storage format)*
   
   ### Documentation
   
   *(Does this change introduce a new feature)*
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi merged pull request #1065: [flink] add set type for mysql cdc action

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #1065:
URL: https://github.com/apache/incubator-paimon/pull/1065


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1065: [flink] add set type for mysql cdc action

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #1065:
URL: https://github.com/apache/incubator-paimon/pull/1065#discussion_r1185639714


##########
paimon-common/src/test/java/org/apache/paimon/data/DataFormatTestUtil.java:
##########
@@ -43,6 +44,13 @@ public static String toStringNoRowKind(InternalRow row, RowType type) {
                 Object field = fieldGetter.getFieldOrNull(row);
                 if (field instanceof byte[]) {
                     build.append(Arrays.toString((byte[]) field));
+                } else if (field instanceof ColumnarArray) {

Review Comment:
   `instanceof InternalArray`?



##########
paimon-common/src/main/java/org/apache/paimon/utils/TypeUtils.java:
##########
@@ -115,6 +118,19 @@ public static Object castFromString(String s, DataType type) {
             case TIMESTAMP_WITHOUT_TIME_ZONE:
                 TimestampType timestampType = (TimestampType) type;
                 return toTimestamp(str, timestampType.getPrecision());
+            case ARRAY:
+                ArrayType arrayType = (ArrayType) type;

Review Comment:
   if str startswith "[", remove "[".
   if str endswith "]", remove "]".



##########
paimon-common/src/test/java/org/apache/paimon/data/DataFormatTestUtil.java:
##########
@@ -43,6 +44,13 @@ public static String toStringNoRowKind(InternalRow row, RowType type) {
                 Object field = fieldGetter.getFieldOrNull(row);
                 if (field instanceof byte[]) {
                     build.append(Arrays.toString((byte[]) field));
+                } else if (field instanceof ColumnarArray) {
+                    ColumnarArray columnarArray = (ColumnarArray) field;
+                    String[] result = new String[columnarArray.size()];
+                    for (int j = 0; j < columnarArray.size(); j++) {
+                        result[j] = columnarArray.getString(j).toString();

Review Comment:
   here we can use `InternalArray.ElementGetter` to get object and to string.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] zhangjun0x01 commented on pull request #1065: [flink] add set type for mysql cdc action

Posted by "zhangjun0x01 (via GitHub)" <gi...@apache.org>.
zhangjun0x01 commented on PR #1065:
URL: https://github.com/apache/incubator-paimon/pull/1065#issuecomment-1534860650

   <img width="1095" alt="image" src="https://user-images.githubusercontent.com/25563794/236234304-81fa1dd1-c4a7-4e95-88b5-fa3450b5ef2a.png">
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] zhangjun0x01 commented on pull request #1065: [flink] add set type for mysql cdc action

Posted by "zhangjun0x01 (via GitHub)" <gi...@apache.org>.
zhangjun0x01 commented on PR #1065:
URL: https://github.com/apache/incubator-paimon/pull/1065#issuecomment-1535815440

   <img width="1068" alt="image" src="https://user-images.githubusercontent.com/25563794/236396052-abc72b8f-bfcc-4106-9fb2-18c1f523e1cb.png">
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org