You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "liuyongvs (via GitHub)" <gi...@apache.org> on 2023/07/04 12:20:13 UTC
[GitHub] [flink] liuyongvs commented on a diff in pull request #22946: [FLINK-32530][table] Fix array_position return null value semantic, w…
liuyongvs commented on code in PR #22946:
URL: https://github.com/apache/flink/pull/22946#discussion_r1251955975
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/CollectionFunctionsITCase.java:
##########
@@ -226,7 +226,7 @@ private Stream<TestSetSpec> arrayPositionTestCases() {
CollectionUtil.map(entry(3, "c"), entry(4, "d")),
})
.andDataTypes(
- DataTypes.ARRAY(DataTypes.INT().notNull()).notNull(),
+ DataTypes.ARRAY(DataTypes.INT()).notNull(),
Review Comment:
comments:
why i don't add a new test like f5 below, and change the f0 type
```
data: new Integer[] {null, 1, 2, 2, null}
type: DataTypes.ARRAY(DataTypes.INT()).notNull()
```
the result ARRAY_POSITION(f5, NULL) will return 1, while ARRAY_POSITION(f0, NULL) will return 0.
The result is different. Because the input array type of f0
is ARRAY<INT NOT NULL> NOT NULL, the implicit cast will make the input array to be
[0, 1, 2, 2, 0] at runtime. and it will make user confused.
that is the fo
--
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