You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "dawidwys (via GitHub)" <gi...@apache.org> on 2025/04/28 14:30:31 UTC

[PR] [FLINK-37745] Serialize partial deletes in ChangelogMode to JSON [flink]

dawidwys opened a new pull request, #26516:
URL: https://github.com/apache/flink/pull/26516

   ## What is the purpose of the change
   
   Make it possible to serialize partial deletes into a compiled plan
   
   ## Verifying this change
   
   Added a test in `ChangelogModeJsonSerdeTest`
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (**yes** / no / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented)
   


-- 
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@flink.apache.org

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


Re: [PR] [FLINK-37745] Serialize partial deletes in ChangelogMode to JSON [flink]

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #26516:
URL: https://github.com/apache/flink/pull/26516#issuecomment-2835476572

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "11fea88837a7507ef0d8cee509e7734ea58880fd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "11fea88837a7507ef0d8cee509e7734ea58880fd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 11fea88837a7507ef0d8cee509e7734ea58880fd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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@flink.apache.org

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


Re: [PR] [FLINK-37745] Serialize partial deletes in ChangelogMode to JSON [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #26516:
URL: https://github.com/apache/flink/pull/26516#discussion_r2065732308


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/serde/ChangelogModeJsonDeserializer.java:
##########
@@ -49,8 +51,14 @@ public ChangelogMode deserialize(
         ChangelogMode.Builder builder = ChangelogMode.newBuilder();
         JsonNode rowKindsNode = jsonParser.readValueAsTree();
         for (JsonNode rowKindNode : rowKindsNode) {
-            RowKind rowKind = RowKind.valueOf(rowKindNode.asText().toUpperCase());
-            builder.addContainedKind(rowKind);
+            final String rowKindText = rowKindNode.asText().toUpperCase();

Review Comment:
   ```suggestion
               final String rowKindText = rowKindNode.asText().toUpperCase(Locale.ROOT);
   ```
   what values are planned to be there, should we care. about something tricky e.g. turkish locales?



-- 
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@flink.apache.org

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


Re: [PR] [FLINK-37745] Serialize partial deletes in ChangelogMode to JSON [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #26516:
URL: https://github.com/apache/flink/pull/26516#discussion_r2065732308


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/serde/ChangelogModeJsonDeserializer.java:
##########
@@ -49,8 +51,14 @@ public ChangelogMode deserialize(
         ChangelogMode.Builder builder = ChangelogMode.newBuilder();
         JsonNode rowKindsNode = jsonParser.readValueAsTree();
         for (JsonNode rowKindNode : rowKindsNode) {
-            RowKind rowKind = RowKind.valueOf(rowKindNode.asText().toUpperCase());
-            builder.addContainedKind(rowKind);
+            final String rowKindText = rowKindNode.asText().toUpperCase();

Review Comment:
   ```suggestion
               final String rowKindText = rowKindNode.asText().toUpperCase(Locale.ROOT);
   ```
   what values are planned to be there, should we care. about something tricky e.g. turkish locales?
   i guess only enum values, right?



-- 
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@flink.apache.org

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


Re: [PR] [FLINK-37745] Serialize partial deletes in ChangelogMode to JSON [flink]

Posted by "twalthr (via GitHub)" <gi...@apache.org>.
twalthr commented on code in PR #26516:
URL: https://github.com/apache/flink/pull/26516#discussion_r2065864255


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/serde/ChangelogModeJsonDeserializer.java:
##########
@@ -49,8 +51,14 @@ public ChangelogMode deserialize(
         ChangelogMode.Builder builder = ChangelogMode.newBuilder();
         JsonNode rowKindsNode = jsonParser.readValueAsTree();
         for (JsonNode rowKindNode : rowKindsNode) {
-            RowKind rowKind = RowKind.valueOf(rowKindNode.asText().toUpperCase());
-            builder.addContainedKind(rowKind);
+            final String rowKindText = rowKindNode.asText().toUpperCase();

Review Comment:
   we can also just remove this `toUpperCase` . IMHO `toUpperCase` / `toLowerCase` are just adding unnecessary runtime overhead and lead to weird bugs.



##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/serde/ChangelogModeJsonSerializer.java:
##########
@@ -49,7 +50,12 @@ public void serialize(
             throws IOException {
         jsonGenerator.writeStartArray();
         for (RowKind rowKind : changelogMode.getContainedKinds()) {
-            jsonGenerator.writeString(rowKind.name());
+            if (Objects.requireNonNull(rowKind) == RowKind.DELETE

Review Comment:
   ```suggestion
               if (rowKind == RowKind.DELETE
   ```
   Why should this be null?



-- 
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@flink.apache.org

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


Re: [PR] [FLINK-37745] Serialize partial deletes in ChangelogMode to JSON [flink]

Posted by "dawidwys (via GitHub)" <gi...@apache.org>.
dawidwys merged PR #26516:
URL: https://github.com/apache/flink/pull/26516


-- 
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@flink.apache.org

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