Ramana Inukonda Nagaraj created DRILL-426:
---------------------------------------------

             Summary: JSON with null not working
                 Key: DRILL-426
                 URL: https://issues.apache.org/jira/browse/DRILL-426
             Project: Apache Drill
          Issue Type: Bug
            Reporter: Ramana Inukonda Nagaraj


Seeing different errors depending on how we specify null in json.

If we use field:null we get

0: jdbc:drill:> select * from dfs.`/employeeObject8.json`;
+------------+------------+------------+------------+------------+
|   first    |    last    |    age     |    sex     |   salary   |
+------------+------------+------------+------------+------------+
java.lang.IndexOutOfBoundsException
        at io.netty.buffer.EmptyByteBuf.checkIndex(EmptyByteBuf.java:857)
        at io.netty.buffer.EmptyByteBuf.getBytes(EmptyByteBuf.java:321)
        at 
org.apache.drill.exec.vector.VarCharVector$Accessor.get(VarCharVector.java:244)
        at 
org.apache.drill.exec.vector.VarCharVector$Accessor.getObject(VarCharVector.java:262)
        at 
org.apache.drill.exec.vector.NullableVarCharVector$Accessor.getObject(NullableVarCharVector.java:248)
        at 
org.apache.drill.exec.vector.accessor.NullableVarCharAccessor.getObject(NullableVarCharAccessor.java:73)
        at 
org.apache.drill.jdbc.AvaticaDrillSqlAccessor.getObject(AvaticaDrillSqlAccessor.java:136)
        at 
net.hydromatic.avatica.AvaticaResultSet.getObject(AvaticaResultSet.java:336)
        at sqlline.SqlLine$Rows$Row.<init>(SqlLine.java:2388)
        at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2504)
        at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148)
        at sqlline.SqlLine.print(SqlLine.java:1809)
        at sqlline.SqlLine$Commands.execute(SqlLine.java:3766)
        at sqlline.SqlLine$Commands.sql(SqlLine.java:3663)
        at sqlline.SqlLine.dispatch(SqlLine.java:889)
        at sqlline.SqlLine.begin(SqlLine.java:763)
        at sqlline.SqlLine.start(SqlLine.java:498)
        at sqlline.SqlLine.main(SqlLine.java:460)

 if we simply omit the field we get a null pointer exception
message: "Failure while running fragment. < NullPointerException"
]
Error: exception while executing query (state=,code=0)

if we specify null as "\N" ( This is what hive does when writing json)
I get the same null pointer exception. Contact me for logs if needed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to