vvysotskyi commented on a change in pull request #2048: DRILL-7429: Wrong 
column order when selecting complex data using Hive storage plugin
URL: https://github.com/apache/drill/pull/2048#discussion_r403729644
 
 

 ##########
 File path: 
contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/complex_types/TestHiveStructs.java
 ##########
 @@ -234,6 +240,28 @@ public void primitiveStruct() throws Exception {
         .go();
   }
 
+  @Test // DRILL-7429
+  public void testCorrectColumnOrdering() throws Exception {
+    String sql = "SELECT t.str_n0 a, rid b FROM hive.struct_tbl t LIMIT 1";
+    DirectRowSet directRowSet = queryBuilder().sql(sql).rowSet();
+    BatchSchema fields;
+    try {
+      fields = directRowSet.batchSchema();
+    } finally {
+      directRowSet.clear();
+    }
+
+    assertThat(fields.getFieldCount(), is(2));
 
 Review comment:
   We also have `RowSetComparison` class, which allows comparing expected and 
actual row sets, including their schema.
   
   Or if you don't want to populate row set with expected data, you may use the 
`schemaBaseLine()` method from `TestBuilder` to validate query schema only.

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

Reply via email to