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

Flatten does not work with nested maps/unions.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.6.0, 0.7.0
    • 0.7.0
    • Functions - Drill
    • None

    Description

      Minimum reproduce :

      test1.json
       {"data":
           [{"key":"apple","value":{"cnt":1}}, {"key":"orange","value":{"cnt":2}}]
       }
       select flatten(data) from dfs.tmp.`test1.json` as t;
      +------------+
      |   EXPR$0   |
      +------------+
      Query failed: Failure while running fragment.[ 7e60b3fe-198d-4bc5-b440-e6f7a15cc54f on n3a:31010 ]
        (java.lang.UnsupportedOperationException) 
          org.apache.drill.exec.vector.complex.MapVector$MapTransferPair.splitAndTransfer():284
          org.apache.drill.exec.vector.complex.RepeatedMapVector$SingleMapTransferPair.splitAndTransfer():305
          org.apache.drill.exec.test.generated.FlattenerGen80.flattenRecords():106
      
          org.apache.drill.exec.physical.impl.flatten.FlattenRecordBatch.doWork():155
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():89
          org.apache.drill.exec.physical.impl.flatten.FlattenRecordBatch.innerNext():121
          org.apache.drill.exec.record.AbstractRecordBatch.next():106
          org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next():124
          org.apache.drill.exec.record.AbstractRecordBatch.next():86
          org.apache.drill.exec.record.AbstractRecordBatch.next():76
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():52
          org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():129
          org.apache.drill.exec.record.AbstractRecordBatch.next():106
          org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next():124
          org.apache.drill.exec.physical.impl.BaseRootExec.next():67
          org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext():122
          org.apache.drill.exec.physical.impl.BaseRootExec.next():57
          org.apache.drill.exec.work.fragment.FragmentExecutor.run():113
          org.apache.drill.exec.work.WorkManager$RunnableWrapper.run():249
          .......():0
      
      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

        1. Drill-1749.patch
          5 kB
          Jason Altekruse

        Activity

          People

            jaltekruse Jason Altekruse
            haozhu Hao Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: