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

mock-sub-scan is not setting 'lastSet' in NullableVarCharVector or NullableVar16CharVector

    XMLWordPrintableJSON

Details

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

    Description

      Following plan outputs empty values for nullableStr1 column after 1st row.

      {
          head:{
              type:"APACHE_DRILL_PHYSICAL",
              version:"1",
              generator:{
                  type:"manual"
              }
          },
          graph:[
              {
                  @id:1,
                  pop:"mock-sub-scan",
                  url: "http://apache.org",
                  entries:[
                      {records: 100, types: [
                         {name: "nullableStr1", type: "VARCHAR", mode: "OPTIONAL"}
                      ]}
                  ]
              },
              {
                  @id:2,
                  child: 1,
                  pop:"project",
                  exprs: [
                      { ref: "nullableStr1", expr: "nullableStr1" }
                  ]
              },
              {
                  @id: 3,
                  child: 2,
                  pop: "screen"
              }
          ]
      }
      

      After transferring the ValueVector from 'scan' to 'project', ProjectRecordBatch calls NullableVarCharVector.setValueCount. As part of this method, all records from "lastSet +1" to "count" are set to empty byte array, because 'lastSet' is not set as part of the mock-sub-scan (default to 0), all but the first record have empty string data.

          public void setValueCount(int valueCount) {
           .....
            for (int i = lastSet + 1; i < valueCount; i++) {
              values.getMutator().set(i, new byte[]{});
            }
           ....
          }
      

      Attachments

        1. DRILL-425.patch
          1 kB
          Steven Phillips

        Issue Links

          Activity

            People

              sphillips Steven Phillips
              vkorukanti Venki Korukanti
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: