vvysotskyi commented on a change in pull request #2238:
URL: https://github.com/apache/drill/pull/2238#discussion_r642113191
##########
File path:
exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetScan.java
##########
@@ -51,4 +53,57 @@ public void testSuccessFile() throws Exception {
.build()
.run();
}
+
+ @Test
+ public void testTypeNull() throws Exception {
+ /* the `features` schema is:
+ optional group features {
+ required int32 type (INTEGER(8,true));
+ optional int32 size;
+ optional group indices (LIST) {
+ repeated group list {
+ required int32 element;
+ }
+ }
+ optional group values (LIST) {
+ repeated group list {
+ required double element;
+ }
+ }
+ }
+ */
+ String sql = "SELECT * FROM cp.`parquet/test_type_null.parquet`";
+ testBuilder()
+ .sqlQuery(sql)
+ .unOrdered()
+ .baselineColumns("label", "features")
+ .baselineValues(0.0d, new JsonStringHashMap<String, Object>() {{
+ put("type", 1);
+ put("indices", new JsonStringArrayList<Double>());
+ put("values", new JsonStringArrayList<Double>() {{
+ add(112.0d);
+ add(213.0d);
+ add(213.0d);
+ }});
+ }})
+ .baselineValues(0.0d, new JsonStringHashMap<String, Object>() {{
+ put("type", 1);
+ put("indices", new JsonStringArrayList<Double>());
+ put("values", new JsonStringArrayList<Double>() {{
+ add(213.0d);
+ add(123.0d);
+ add(123.0d);
+ }});
+ }})
+ .baselineValues(2.0d, new JsonStringHashMap<String, Object>() {{
+ put("type", 1);
+ put("indices", new JsonStringArrayList<Double>());
+ put("values", new JsonStringArrayList<Double>() {{
+ add(333.0d);
+ add(333.0d);
+ add(333.0d);
+ }});
+ }})
Review comment:
Please use `TestBuilder.listOf()` and `TestBuilder.mapOf()` methods, it
will be mor ecompact:
```suggestion
.baselineValues(0.0d,
mapOf(
"type", 1,
"indices", listOf(),
"values", listOf(112.0d, 213.0d, 213.0d)))
.baselineValues(0.0d,
mapOf(
"type", 1,
"indices", listOf(),
"values", listOf(213.0d, 123.0d, 123.0d)))
.baselineValues(2.0d,
mapOf(
"type", 1,
"indices", listOf(),
"values", listOf(333.0d, 333.0d, 333.0d)))
```
--
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]