You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Jean-Claude Cote <jc...@gmail.com> on 2018/10/21 13:23:59 UTC

msgpack test case fails same as with json, problem with testing framework?

I trying to write a test case for a repeated map scenario. However testing
framework is unable to infer the schema of the resultset? I'm using the API
correctly?

Thanks
jc

// create a test file
    try (OutputStreamWriter w = new OutputStreamWriter(new
FileOutputStream(new File(testDir, "test.json")))) {
      w.write("{\"arrayOfMap\":[{\"type\": 3, \"data\": 44}]}\n");
    }

// read the test file
    String sql = "select * from `dfs.data`.`test.json`";
    RowSet actual = client.queryBuilder().sql(sql).rowSet();

// error outputted
java.lang.NullPointerException: null
        at
org.apache.drill.exec.physical.rowSet.model.single.SingleSchemaInference.inferVector(SingleSchemaInference.java:70)
~[drill-java-exec-1.15.0-SNAPSHOT.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.exec.physical.rowSet.model.single.SingleSchemaInference.inferMapSchema(SingleSchemaInference.java:91)
~[drill-java-exec-1.15.0-SNAPSHOT.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.exec.physical.rowSet.model.single.SingleSchemaInference.inferVector(SingleSchemaInference.java:73)
~[drill-java-exec-1.15.0-SNAPSHOT.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.exec.physical.rowSet.model.single.SingleSchemaInference.infer(SingleSchemaInference.java:64)
~[drill-java-exec-1.15.0-SNAPSHOT.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.test.rowSet.DirectRowSet.fromContainer(DirectRowSet.java:77)
~[drill-java-exec-1.15.0-SNAPSHOT-tests.jar:1.15.0-SNAPSHOT]
        at org.apache.drill.test.QueryBuilder.rowSet(QueryBuilder.java:363)
~[drill-java-exec-1.15.0-SNAPSHOT-tests.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.exec.store.msgpack.TestMsgpackRecordReader.testSchemaRepeatedMapWithFieldWithDifferentTypes(TestMsgpackRecordReader.java:245)
~[test-classes/:na]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]

Re: msgpack test case fails same as with json, problem with testing framework?

Posted by Paul Rogers <pa...@yahoo.com.INVALID>.
May be a bug in my code. Please create a JIRA ticket and attach your input file and test code so I can reproduce the problem.

Thanks,
- Paul

 

    On Sunday, October 21, 2018, 6:24:18 AM PDT, Jean-Claude Cote <jc...@gmail.com> wrote:  
 
 I trying to write a test case for a repeated map scenario. However testing
framework is unable to infer the schema of the resultset? I'm using the API
correctly?

Thanks
jc

// create a test file
    try (OutputStreamWriter w = new OutputStreamWriter(new
FileOutputStream(new File(testDir, "test.json")))) {
      w.write("{\"arrayOfMap\":[{\"type\": 3, \"data\": 44}]}\n");
    }

// read the test file
    String sql = "select * from `dfs.data`.`test.json`";
    RowSet actual = client.queryBuilder().sql(sql).rowSet();

// error outputted
java.lang.NullPointerException: null
        at
org.apache.drill.exec.physical.rowSet.model.single.SingleSchemaInference.inferVector(SingleSchemaInference.java:70)
~[drill-java-exec-1.15.0-SNAPSHOT.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.exec.physical.rowSet.model.single.SingleSchemaInference.inferMapSchema(SingleSchemaInference.java:91)
~[drill-java-exec-1.15.0-SNAPSHOT.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.exec.physical.rowSet.model.single.SingleSchemaInference.inferVector(SingleSchemaInference.java:73)
~[drill-java-exec-1.15.0-SNAPSHOT.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.exec.physical.rowSet.model.single.SingleSchemaInference.infer(SingleSchemaInference.java:64)
~[drill-java-exec-1.15.0-SNAPSHOT.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.test.rowSet.DirectRowSet.fromContainer(DirectRowSet.java:77)
~[drill-java-exec-1.15.0-SNAPSHOT-tests.jar:1.15.0-SNAPSHOT]
        at org.apache.drill.test.QueryBuilder.rowSet(QueryBuilder.java:363)
~[drill-java-exec-1.15.0-SNAPSHOT-tests.jar:1.15.0-SNAPSHOT]
        at
org.apache.drill.exec.store.msgpack.TestMsgpackRecordReader.testSchemaRepeatedMapWithFieldWithDifferentTypes(TestMsgpackRecordReader.java:245)
~[test-classes/:na]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]