gustavodemorais commented on code in PR #26022:
URL: https://github.com/apache/flink/pull/26022#discussion_r1925151673
##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Expressions.java:
##########
@@ -861,9 +862,13 @@ public static ApiExpression withoutColumns(Object head,
Object... tail) {
* jsonObject(JsonOnNull.ABSENT, "K1", nullOf(DataTypes.STRING())) // "{}"
*
* // {"K1":{"K2":"V"}}
+ * jsonObject(JsonOnNull.NULL, "K1", json('{"K2":"V"}'))
Review Comment:
The string doesn't have to be escaped, I've updated the javadoc for the java
expression and added one example using string literals that show that there's
no need to escape it
```
* // {"K":{"K2":{"K3":42}}}
* jsonObject(
* JsonOnNull.NULL,
* "K",
* json("""
* {
* "K2": {
* "K3": 42
* }
* }
* """))
```
We escape in the java code since java also uses `"` to express strings. If
using single quotes in python or string literals in java, there's no need to
escape. If they're escaped, they are also processed properly as well and result
in the same json object.
--
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]