[ 
https://issues.apache.org/jira/browse/CALCITE-3065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16841934#comment-16841934
 ] 

Jiatao Tao edited comment on CALCITE-3065 at 5/17/19 6:04 AM:
--------------------------------------------------------------

Hi [~danny0405]

you mean literal.getType? *SqlTypeName typeName* is Integer, from the first 
coommet, I didn't argue that.

 

But the value of RexLiteral is decimal, so I do 
this:*literal.getValueAs(Otherwise why exists this method)*.

 

code from previous comment:
 val tp = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT)
 
literal.getValueAs(tp.getJavaClass(literal.getType).asInstanceOf[java.lang.Class[_]])
  

*literal.getType ->* INTEGER

 

*tp.getJavaClass*(*INTEGER*) -> int

 

literal.getValueAs does not process `int` scenario.

 

I didn't get your point, hope to hear your voice.

 

Thanks.

 


was (Author: aron.tao):
Hi [~danny0405]

you mean literal.getType? *SqlTypeName typeName* is Integer, from the first 
coommet, I didn't argue that.

 

But the value of RexLiteral is decimal, so I do this:*literal.getValueAs*.

 

code from previous comment:
val tp = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT)
literal.getValueAs(tp.getJavaClass(literal.getType).asInstanceOf[java.lang.Class[_]])
 

*literal.getType ->* INTEGER

 

*tp.getJavaClass*(*INTEGER*) -> int

 

literal.getValueAs does not process `int` scenario.

 

I didn't get your point, hope to hear your voice.

 

Thanks.

 

> RexLiteral#getValueAs should consider primitive type
> ----------------------------------------------------
>
>                 Key: CALCITE-3065
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3065
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Jiatao Tao
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2019-05-13-12-04-36-365.png
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> !image-2019-05-13-12-04-36-365.png!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to