raminqaf commented on code in PR #29279:
URL: https://github.com/apache/flink/pull/29279#discussion_r4102730639
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/expressions/converter/ExpressionConverterTest.java:
##########
@@ -220,4 +226,41 @@ void testUuidLiteralFromBytes() {
assertThat(((RexLiteral) rex).getValueAs(UUID.class)).isEqualTo(uuid);
assertThat(rex.getType().getSqlTypeName()).isEqualTo(SqlTypeName.UUID);
}
+
+ @Test
+ void testCastToNotNullTypeFromNullableInput() {
+ final RexNode rex =
+ convertCast(
+ valueLiteral(null, DataTypes.INT()),
+ DataTypes.BIGINT().notNull(),
+ DataTypes.BIGINT());
+ assertThat(rex.getType().isNullable()).isTrue();
+ }
+
+ @Test
+ void testCastToNotNullTypeFromNestedVariantInput() {
+ final RexNode rex =
+ convertCast(
+ valueLiteral(null,
DataTypes.ARRAY(DataTypes.VARIANT())),
Review Comment:
Agreed, removed it. The converter no longer looks at the input type; it only
follows the resolved output type, so there is nothing `VARIANT`-specific to
test at this level. The `VARIANT` nullability rules are covered by
`TypeStrategiesTest`.
--
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]