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

Query fails when using flatten on JSON data where some documents have an empty array

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 1.10.0
    • Storage - JSON
    • None

    Description

      Drill query fails when using flatten when some records contain an empty array

      SELECT COUNT(*) FROM (SELECT FLATTEN(t.a.b.c) AS c FROM dfs.`flat.json` t) flat WHERE flat.c.d.e = 'f' limit 1;
      

      Succeeds on
      { "a": { "b": { "c": [ { "d":

      { "e": "f" }

      } ] } } }

      Fails on
      { "a": { "b":

      { "c": [] }

      } }

      Error

      Error: SYSTEM ERROR: ClassCastException: Cannot cast org.apache.drill.exec.vector.NullableIntVector to org.apache.drill.exec.vector.complex.RepeatedValueVector
      

      Is it possible to ignore the empty arrays, or do they need to be populated with dummy data?

      Attachments

        Issue Links

          Activity

            People

              sharnyk Serhii Harnyk
              dekken Philip Deegan
              Rahul Kumar Challapalli Rahul Kumar Challapalli
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: