dawidwys commented on a change in pull request #9915:
[FLINK-14415][table-common] ValueLiteralExpression#equals should take array
value into account
URL: https://github.com/apache/flink/pull/9915#discussion_r339082528
##########
File path:
flink-table/flink-table-common/src/test/java/org/apache/flink/table/expressions/ExpressionTest.java
##########
@@ -69,6 +70,27 @@ public void testExpressionEquality() {
assertEquals(TREE_WITH_VALUE, TREE_WITH_SAME_VALUE);
}
+ @Test
+ public void testArrayValueLiteralEquality() {
+ assertEquals(
+ new ValueLiteralExpression(new Integer[][]{null, null,
{1, 2, 3}}),
+ new ValueLiteralExpression(new Integer[][]{null, null,
{1, 2, 3}}));
+
+ assertEquals(
+ new ValueLiteralExpression(
+ new String[][]{null, null, {"1", "2", "3",
"Dog's"}},
+
DataTypes.ARRAY(DataTypes.ARRAY(DataTypes.STRING()))),
+ new ValueLiteralExpression(
+ new String[][]{null, null, {"1", "2", "3",
"Dog's"}},
+
DataTypes.ARRAY(DataTypes.ARRAY(DataTypes.STRING())))
+ );
+
+ assertEquals(
+ new
ValueLiteralExpression("abc".getBytes(Charset.forName("UTF-8"))),
Review comment:
nit: Use `StandardCharsets.UTF_8` here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services