You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Hisoka-X (via GitHub)" <gi...@apache.org> on 2026/02/05 03:06:53 UTC
[PR] [FLINK-39010][transform] YAML Pipeline supports item subscription of Variant type [flink-cdc]
Hisoka-X opened a new pull request, #4261:
URL: https://github.com/apache/flink-cdc/pull/4261
This close https://issues.apache.org/jira/browse/FLINK-39010
This pull request adds support for subscripting (using square brackets) into VARIANT types in transform, allowing users to access elements and fields within JSON-like data using expressions like `variant_['key']` or `variant_[1]`.
--
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-39010][transform] YAML Pipeline supports item subscription of Variant type [flink-cdc]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #4261:
URL: https://github.com/apache/flink-cdc/pull/4261#discussion_r2766863834
##########
flink-cdc-composer/src/test/resources/specs/nested.yaml:
##########
@@ -35,7 +35,7 @@
id_
PARSE_JSON(id_) AS variant_id_
PARSE_JSON('[' || id_ || ',' || bool_ || ']') AS variant_array_
- PARSE_JSON('{\"id\": ' || id_ || ', \"name\": \"' || string_ || '\"}') AS variant_doc_
+ PARSE_JSON('{"id": ' || id_ || ', "name": "' || string_ || '"}') AS variant_doc_
Review Comment:
Fixing the incorrect usage of the `parse_json` function. cc @lvyanquan @yuxiqian
--
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-39010][transform] YAML Pipeline supports item subscription of Variant type [flink-cdc]
Posted by "yuxiqian (via GitHub)" <gi...@apache.org>.
yuxiqian merged PR #4261:
URL: https://github.com/apache/flink-cdc/pull/4261
--
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-39010][transform] YAML Pipeline supports item subscription of Variant type [flink-cdc]
Posted by "lvyanquan (via GitHub)" <gi...@apache.org>.
lvyanquan commented on PR #4261:
URL: https://github.com/apache/flink-cdc/pull/4261#issuecomment-3857762395
Hi Yuxiqian, could you please make a final confirmation?
--
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-39010][transform] YAML Pipeline supports item subscription of Variant type [flink-cdc]
Posted by "yuxiqian (via GitHub)" <gi...@apache.org>.
yuxiqian commented on code in PR #4261:
URL: https://github.com/apache/flink-cdc/pull/4261#discussion_r2772135771
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/parser/JaninoCompiler.java:
##########
@@ -174,7 +174,10 @@ private static Java.Rvalue translateSqlSqlLiteral(Context context, SqlLiteral sq
Object value = sqlLiteral.getValue();
if (sqlLiteral instanceof SqlCharStringLiteral) {
// Double quotation marks represent strings in Janino.
- value = "\"" + sqlLiteral.getValueAs(NlsString.class).getValue() + "\"";
+ // Escape backslashes first, then double quotes for proper Janino string literals.
+ String stringValue = sqlLiteral.getValueAs(NlsString.class).getValue();
+ stringValue = stringValue.replace("\\", "\\\\").replace("\"", "\\\"");
+ value = "\"" + stringValue + "\"";
Review Comment:
Nice catch! I confirmed the implementation is the same as Apache common's `StringEscapeUtils#escapeJava`.
<img width="1097" height="125" alt="Image" src="https://github.com/user-attachments/assets/86cb20c9-4c53-46b3-b4d5-f6b87174e132" />
--
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