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

CONVERT_FROM_JSON on a non-existent column throws NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Storage - JSON
    • None

    Description

      Query

      SELECT CONVERT_FROM(columns[1], 'JSON') as col1 FROM dfs.`file1.tbl`;
      

      where file1.tbl is a file with single column (it has only columns[0]) returns error

      Error: SYSTEM ERROR: NullPointerException
      
      Fragment 0:0
      
      [Error Id: 85b7fa7f-2049-4c8b-8c96-805af218f118 on node1:31010] (state=,code=0)
      

      It should return single row with null value since CONVERT_FROM is executed on the column that does not exists.

      Problem description
      convert_fromJSON function considers only non-nullable VarCharHolder, but for this case, we receive NullableVarCharHolder which has a null value. So convert_fromJSON function that takes NullableVarCharHolder as an input parameter should be added.

      cat file1.tbl
      "{a:1}"
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              volodymyr Vova Vysotskyi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: