twalthr commented on a change in pull request #17658:
URL: https://github.com/apache/flink/pull/17658#discussion_r743516392
##########
File path:
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/casting/CastRulesTest.java
##########
@@ -60,39 +112,142 @@
.fromCase(SMALLINT(), (short) 10, 10L)
.fromCase(TINYINT(), (byte) 10, 10L),
CastTestSpecBuilder.testCastTo(STRING())
+ .fromCase(STRING(), null, null)
+ .fromCase(
+ CHAR(3), StringData.fromString("foo"),
StringData.fromString("foo"))
+ .fromCase(
+ VARCHAR(5),
+ StringData.fromString("Flink"),
+ StringData.fromString("Flink"))
+ .fromCase(
+ VARCHAR(10),
+ StringData.fromString("Flink"),
+ StringData.fromString("Flink"))
+ .fromCase(
+ STRING(),
+ StringData.fromString("Apache Flink"),
+ StringData.fromString("Apache Flink"))
+ .fromCase(BOOLEAN(), true,
StringData.fromString("true"))
+ .fromCase(BOOLEAN(), false,
StringData.fromString("false"))
+ .fromCase(
+ BINARY(2), new byte[] {0, 1},
StringData.fromString("\u0000\u0001"))
+ .fromCase(
+ VARBINARY(3),
+ new byte[] {0, 1, 2},
+ StringData.fromString("\u0000\u0001\u0002"))
+ .fromCase(
+ VARBINARY(5),
+ new byte[] {0, 1, 2},
+ StringData.fromString("\u0000\u0001\u0002"))
+ .fromCase(
+ BYTES(),
+ new byte[] {0, 1, 2, 3, 4},
+
StringData.fromString("\u0000\u0001\u0002\u0003\u0004"))
+ .fromCase(
+ DECIMAL(4, 3),
+ DecimalData.fromBigDecimal(new
BigDecimal("9.87"), 4, 3),
+ StringData.fromString("9.870"))
+ .fromCase(
+ DECIMAL(5, 3),
+ DecimalData.fromBigDecimal(new
BigDecimal("9.87"), 5, 3),
+ StringData.fromString("9.870"))
Review comment:
ignore this comment
--
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]