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

Casting to BigInt from Varchar produces wrong results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 0.4.0
    • Functions - Drill
    • None

    Description

      Can be reproduced using the following plan:

      {
      head:{
      type:"APACHE_DRILL_PHYSICAL",
      version:"1",
      generator:

      { type:"manual" }

      },
      graph:[
      {
      @id:1,
      pop:"json-scan",
      entries: [

      { path : "/tmp/scan4.json" }

      ],
      storageengine:

      { "type": "json", "dfsName": "file:///" }

      },
      {
      pop:"project",
      @id:2,
      child: 1,
      exprs: [

      { ref: "int", expr: "cast(integer as bigint)" }

      ]
      },

      { @id: 3, child: 2, pop: "screen" }

      ]
      }

      Input file, "/tmp/scan4.json":
      {
      "integer" : "2008"
      }
      {
      "integer" : "2007"
      }
      {
      "integer" : "2006"
      }

      Output:
      2008
      2008
      2008

      From the above output we notice that it always generates values corresponding to the first row. Looks like the buffer is not getting reset to the next row.

      Attachments

        1. DRILL-366.patch
          9 kB
          Mehant Baid

        Activity

          People

            mehant Mehant Baid
            mehant Mehant Baid
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: