You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "snuyanzin (via GitHub)" <gi...@apache.org> on 2026/08/12 08:09:01 UTC
[PR] [FLINK-40373][table] `JSON_VALUE` might fail on code gen for null input [flink]
snuyanzin opened a new pull request, #28958:
URL: https://github.com/apache/flink/pull/28958
## What is the purpose of the change
The problem is the query like
```sql
SELECT json_value(null, '$.type'), json_value(null, '$.type');
## Brief change log
json
## Verifying this change
test is provided
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): ( no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable)
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change the checkbox below to `[X]` and replace the placeholder in the "Generated-by"
line with the tool name and version. Otherwise remove the "Generated-by" line.
See the ASF Generative Tooling Guidance for details:
https://www.apache.org/legal/generative-tooling.html
You are responsible for the quality and correctness of every change in this PR
regardless of the tooling used. Low-effort AI-generated PRs will be closed. See
AGENTS.md for the full guidance.
-->
- [ ] Yes (please specify the tool below)
Generated-by: [Tool Name and Version]
--
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-40373][table] `JSON_VALUE` might fail on code gen for null input [flink]
Posted by "gustavodemorais (via GitHub)" <gi...@apache.org>.
gustavodemorais commented on code in PR #28958:
URL: https://github.com/apache/flink/pull/28958#discussion_r3765308297
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/JsonFunctionsITCase.java:
##########
@@ -525,6 +528,10 @@ private static TestSetSpec jsonValueSpec() {
.testSqlResult(
"JSON_VALUE(f0, '$.type'), JSON_VALUE(f0, '$.age')",
List.of("account", "42"),
+ List.of(STRING(), STRING()))
+ .testSqlResult(
+ "JSON_VALUE(f1, '$.type'), JSON_VALUE(f2, '$.type')",
Review Comment:
The tests cover BYTES and ROW; The repro from the PR description isn't tested or am I missing something? (SELECT json_value(null, '$.type'), json_value(null, '$.type'))
--
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-40373][table] `JSON_VALUE` might fail on code gen for null input [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #28958:
URL: https://github.com/apache/flink/pull/28958#issuecomment-5264184594
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4e20b47b8db792a834ea0442f13b6ae793cade03",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "4e20b47b8db792a834ea0442f13b6ae793cade03",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4e20b47b8db792a834ea0442f13b6ae793cade03 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-40373][table] `JSON_VALUE` might fail on code gen for null input [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin merged PR #28958:
URL: https://github.com/apache/flink/pull/28958
--
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-40373][table] `JSON_VALUE` might fail on code gen for null input [flink]
Posted by "twalthr (via GitHub)" <gi...@apache.org>.
twalthr commented on code in PR #28958:
URL: https://github.com/apache/flink/pull/28958#discussion_r3764774585
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/JsonFunctionsITCase.java:
##########
@@ -407,8 +408,8 @@ private static TestSetSpec jsonExistsSpec() {
private static TestSetSpec jsonValueSpec() {
final String jsonValue = getJsonFromResource("/json/json-value.json");
return TestSetSpec.forFunction(BuiltInFunctionDefinitions.JSON_VALUE)
- .onFieldsWithData(jsonValue)
- .andDataTypes(STRING())
+ .onFieldsWithData(jsonValue, jsonValue.getBytes(StandardCharsets.UTF_8), Row.of(jsonValue))
+ .andDataTypes(STRING(), VARBINARY(Integer.MAX_VALUE), ROW(FIELD("json", STRING())))
Review Comment:
```suggestion
.andDataTypes(STRING(), BYTES(), ROW(FIELD("json", 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@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40373][table] `JSON_VALUE` might fail on code gen for null input [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #28958:
URL: https://github.com/apache/flink/pull/28958#discussion_r3765392533
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/JsonFunctionsITCase.java:
##########
@@ -525,6 +528,10 @@ private static TestSetSpec jsonValueSpec() {
.testSqlResult(
"JSON_VALUE(f0, '$.type'), JSON_VALUE(f0, '$.age')",
List.of("account", "42"),
+ List.of(STRING(), STRING()))
+ .testSqlResult(
+ "JSON_VALUE(f1, '$.type'), JSON_VALUE(f2, '$.type')",
Review Comment:
`null` was mentioned as the only valid example here
others just invalid, however leads to same functionality, i'll add a test for `null` to avoid confusions
--
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