[
https://issues.apache.org/jira/browse/DRILL-366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mehant Baid updated DRILL-366:
------------------------------
Attachment: DRILL-366.patch
Review board: https://reviews.apache.org/r/17988/
private branch: https://github.com/mehant/incubator-drill/tree/castToBigIntBug
Minor issue in casting function where we always read the bytes starting from 0
instead of 'start' (first offset into the buffer)
> Casting to BigInt from Varchar produces wrong results
> -----------------------------------------------------
>
> Key: DRILL-366
> URL: https://issues.apache.org/jira/browse/DRILL-366
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Mehant Baid
> Assignee: Mehant Baid
> Priority: Blocker
> Attachments: DRILL-366.patch
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)