Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2206

Error message must be updated when querying a JSON file with arrays in first level

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • Future
    • Storage - JSON
    • None

    Description

      Structure of the file:

      [
        {
          "key": "value",
          ...
        },
        {
         ...
        }
      ]
      

      Valid Error Message:

      > select * from `file.json`;
      Query failed: Query stopped., Drill doesn't support objects whose first level is a scalar or array.  Objects must start as maps. [ 1dc6dfc2-77ed-4a22-8ef0-e5a31c24f6fb on abhi8.qa.lab:31010 ]
      Error: exception while executing query: Failure while executing query. (state=,code=0)
      

      Error message to be updated:

      > select count(*) from `file.json`;
      +------------+
      |   EXPR$0   |
      +------------+
      Query failed: RemoteRpcException: Failure while running fragment., You tried to do a batch data read operation when you were in a state of STOP.  You can only do this type of operation when you are in a state of OK or OK_NEW_SCHEMA. [ 08135c32-fbb8-445e-8c0e-05292e6613e2 on abhi8.qa.lab:31010 ]
      [ 08135c32-fbb8-445e-8c0e-05292e6613e2 on abhi8.qa.lab:31010 ]
      
      java.lang.RuntimeException: java.sql.SQLException: Failure while executing query.
      	at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
      	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)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              agirish Abhishek Girish
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: