[ 
https://issues.apache.org/jira/browse/DRILL-364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jinfeng Ni updated DRILL-364:
-----------------------------

    Attachment: Drill-364.patch.2.txt

Revised patch based on review comment. 

> Casting to VarChar throws error CompileException
> ------------------------------------------------
>
>                 Key: DRILL-364
>                 URL: https://issues.apache.org/jira/browse/DRILL-364
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Mehant Baid
>            Assignee: Jinfeng Ni
>            Priority: Minor
>         Attachments: Drill-364.patch.2.txt
>
>
> This can be reproduced using the below physical plan:
> {       
>     head:{  
>         type:"APACHE_DRILL_PHYSICAL",
>         version:"1",
>         generator:{
>             type:"manual"
>         }     
>     },      
>         graph:[
>         {
>             @id:1,
>             pop:"json-scan",
>             entries: [
>                 {
>                     path : "/tmp/scan.json"
>                 }
>             ],
>             storageengine: {
>                 "type": "json",
>                 "dfsName": "file:///"
>             }
>         },
>         {
>             pop:"project",
>             @id:2,
>             child: 1,
>             exprs: [ { 
>               ref: "VarCharCast",
>               expr: "cast(integer as varchar(30))"
>             } ]
>         },
>         {
>             @id: 3,
>             child: 2,
>             pop: "screen"   
>         }
>     ]     
> } 
> The input file, "/tmp/scan.json" is as follows
> {
>   "integer" : 2008
> }
> It fails with the error: "org.codehaus.commons.compiler.CompileException
> Line 55, Column 38: No applicable constructor/method found for actual 
> parameters"
> From the error, its clear that its not able to find a method. The line its 
> complaining about is:
> vv6 .getMutator().set((outIndex), out5);
> vv6 is a VarCharVector and out5 is a NullableVarCharHolder. So its unable to 
> find a set() function with parameters (int, NullableVarCharHolder). We do 
> have a function in VarCharVector that matches the required signature but its 
> 'protected' hence cannot be called from here. The only way to call that 
> function is from within the set function of NullableVarCharVector. 
> Looks like a minor bug in the generated code for project, vv6 should be 
> declared a NullableVarCharVector. 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to