wangwei1025 commented on a change in pull request #15939:
URL: https://github.com/apache/flink/pull/15939#discussion_r640356827



##########
File path: 
flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFileSystemITCase.java
##########
@@ -164,4 +167,40 @@ public void testOrcFilterPushDown() throws 
ExecutionException, InterruptedExcept
                 "select x, y from orcFilterTable where g = timestamp 
'2020-01-01 05:20:00' and x = 'x10'",
                 Collections.singletonList(Row.of("x10", "10")));
     }
+
+    @Test
+    public void testNestedTypes() throws ExecutionException, 
InterruptedException {
+        String path =
+                
this.getClass().getClassLoader().getResource("test-data-nested.orc").getPath();
+        super.tableEnv()
+                .executeSql(
+                        String.format(
+                                "create table orcNestedTypesTable ("
+                                        + "boolean1 boolean,"
+                                        + "byte1 tinyint,"
+                                        + "short1 smallint,"
+                                        + "int1 int,"
+                                        + "long1 bigint,"
+                                        + "float1 float,"
+                                        + "double1 double,"
+                                        + "string1 string,"
+                                        + "middle ROW<list ARRAY<ROW<int1 
int,string1 string>>>,"
+                                        + "list ARRAY<ROW<int1 int,string1 
string>>,"
+                                        + "map MAP<string,ROW<int1 int,string1 
string>>"
+                                        + ") with ("
+                                        + "'connector' = 'filesystem',"
+                                        + "'format' = 'orc',"
+                                        + "'path' = '%s')",
+                                path));
+
+        TableResult tableResult = super.tableEnv().executeSql("SELECT * FROM 
orcNestedTypesTable");
+        List<Row> rows = new ArrayList<>();
+        tableResult.collect().forEachRemaining(rows::add);
+        assertEquals(
+                "+I[false, 1, 1024, 65536, 9223372036854775807, 1.0, -15.0, 
hi, +I[[+I[1, bye], +I[2, sigh]]], [+I[3, good], +I[4, bad]], {}]",

Review comment:
       Generate a new orc file with empty arrays, and null values




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


Reply via email to