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.
--
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]