snuyanzin commented on code in PR #26954:
URL: https://github.com/apache/flink/pull/26954#discussion_r2874285401


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlDdlToOperationConverterTest.java:
##########
@@ -951,11 +950,15 @@ void testCreateTableWithFullDataTypes() {
         final CalciteParser parser = getParserBySqlDialect(SqlDialect.DEFAULT);
         SqlNode node = parser.parse(sql);
         assertThat(node).isInstanceOf(SqlCreateTable.class);
-        Operation operation =
-                SqlNodeToOperationConversion.convert(planner, catalogManager, 
node).get();
-        TableSchema schema = ((CreateTableOperation) 
operation).getCatalogTable().getSchema();
-        Object[] expectedDataTypes = testItems.stream().map(item -> 
item.expectedType).toArray();
-        assertThat(schema.getFieldDataTypes()).isEqualTo(expectedDataTypes);
+        final Optional<Operation> convert =
+                SqlNodeToOperationConversion.convert(planner, catalogManager, 
node);
+        assertThat(convert).isPresent();
+        Operation operation = convert.get();
+        ResolvedSchema schema =
+                ((CreateTableOperation) 
operation).getCatalogTable().getResolvedSchema();
+        List<Object> expectedDataTypes =

Review Comment:
   How about replacing method
   ```java
   private static TestItem createTestItem(Object... args) {
   ...
   }
   ```
   with
   ```java
       private static TestItem createTestItem(String expr, String error) {
           TestItem testItem = TestItem.fromTestExpr(expr);
           testItem.withExpectedError(error);
           return testItem;
       }
   
       private static TestItem createTestItem(String expr, DataType dataType) {
           TestItem testItem = TestItem.fromTestExpr(expr);
           testItem.withExpectedType(dataType);
           return testItem;
       }
   ```
   
   then 
   ```java
   List<Object> expectedDataTypes
   ...
   ```
   type could be used like  
   ```java
   List<DataType> expectedDataTypes
   ```



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