matriv commented on a change in pull request #17341:
URL: https://github.com/apache/flink/pull/17341#discussion_r717374754



##########
File path: 
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/BuiltInFunctionTestBase.java
##########
@@ -383,18 +439,69 @@ public String toString() {
         }
     }
 
-    private static class SqlErrorTestItem extends ErrorTestItem {
-        final String expression;
+    private static class SqlErrorTestItem extends ErrorTestItem<String> {
 
         private SqlErrorTestItem(
                 String expression, String errorMessage, boolean 
expectedDuringValidation) {
-            super(errorMessage, expectedDuringValidation);
-            this.expression = expression;
+            super(expression, errorMessage, expectedDuringValidation);
+        }
+
+        @Override
+        String expression() {
+            return expression;
         }
 
         @Override
         public String toString() {
             return "[SQL] " + expression;
         }
     }
+
+    private static List<DataType> createDataTypes(
+            DataTypeFactory dataTypeFactory, AbstractDataType<?>[] dataTypes) {
+        return Stream.of(dataTypes)
+                .map(dataTypeFactory::createDataType)
+                .collect(Collectors.toList());
+    }
+
+    /** Helper POJO to store test parameters. */
+    public static class TableTestSpecColumn {
+
+        Expression tableApiExpression;
+        String sqlExpression;
+        Object result;
+        AbstractDataType<?> tableApiDataType;
+        AbstractDataType<?> sqlDataType;
+
+        public static TableTestSpecColumn of(
+                Expression tableApiExpression,
+                String sqlExpression,
+                Object result,
+                AbstractDataType<?> dataType) {
+            return of(tableApiExpression, sqlExpression, result, dataType, 
dataType);
+        }
+
+        public static TableTestSpecColumn of(
+                Expression tableApiExpression,
+                String sqlExpression,
+                Object result,
+                AbstractDataType<?> tableApiDataType,
+                AbstractDataType<?> sqlQueryDataType) {

Review comment:
       I kept this variant exposed as there are a couple of tests in 
`JsonFunctionsITCase` that make use of different return data types: 
https://github.com/apache/flink/pull/17341/files#diff-14f6e87fed00e28afef4a5e995126c430b4065661e3dc2f66d14f3741378f874R180




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


Reply via email to