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

JSON read fails if rows have different number of fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.4.0
    • None
    • None

    Description

      Query:
      0: jdbc:drill:> select * from dfs.`/user/root/employeeObject.json`;

      Notice the input file has different fields.
      Json file:
      {
      "first": "Jimmy1",
      "age": 29,
      "sex": "M",
      "salary": 6300.10
      }
      {
      "first": "Jimmy",
      "last": "James",
      "age": 29,
      "sex": "M",
      "salary": 6300.10
      }
      {
      "first": "Jimmy",
      "sex": "M",
      "salary": 6300.10
      "wealth":100000
      }

      This works though:
      {
      "first": "Jimmy1",
      "age": 29,
      "sex": "M",
      "salary": 6300.10
      }
      {
      "first": "Jimmy",
      "last": "James",
      "age": 29,
      "sex": "M",
      "mom": "testString",
      "salary": 6300.10
      }
      0: jdbc:drill:> select * from dfs.`/user/root/employeeObject.json`;
      --------------------------------------------------------------+

      first age sex salary last mom

      --------------------------------------------------------------+

      Jimmy1 29 M 6300.1 null null
      Jimmy 29 M 6300.1 James testString

      --------------------------------------------------------------+

      After playing around a bit, looks like this only happens if the extra field is a float. Works perfectly if extra fields are int or string.

      Attachments

        Activity

          People

            sphillips Steven Phillips
            inramana Ramana Inukonda Nagaraj
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: