arina-ielchiieva commented on a change in pull request #1778: DRILL-7233: 
Format Plugin for HDF5
URL: https://github.com/apache/drill/pull/1778#discussion_r364640539
 
 

 ##########
 File path: 
contrib/format-hdf5/src/test/java/org/apache/drill/exec/store/hdf5/TestHDF5Format.java
 ##########
 @@ -887,6 +887,69 @@ public void testExplicitQueryWithCompressedFile() throws 
RpcException, IOExcepti
     new RowSetComparison(expected).unorderedVerifyAndClearAll(results);
   }
 
+  @Test
+  public void testProvidedSchema() throws Exception {
 
 Review comment:
   This test does not test schema provisioning.
   
   There are two approaches to use schema provisioning:
   1. using schema file but for it to work you need to turn one certain session 
option.
   2. using table function.
   
   You are using first approach, since you did not set to true session option 
that allows schema provisioning usage, I don't think schema was used. You can 
simply check this but looking at the query plan, it it will show that schema 
file was not used. Second problem, is that adding schema file to the table you 
are using in other tests, this is not safe. 
   
   I suggest you use table function, this way you won't need to create schema 
file and set session option, especially taking into account that your query is 
already using table function.
   
   ```
   SELECT * FROM table(dfs.`hdf5/non-scalar.h5` (type => 'hdf5', defaultPath => 
'/compound', schema => 'inline=(field_1 int not null, field_2 float not null, 
field_3 varchar not null)')) WHERE field_1 < 5
   ```
   Even better you can add some non-existent field with default value to the 
schema to see if it is returned:
   
   ```
    col_i int default `15`
   ```

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