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

Danny Chan commented on CALCITE-3065:
-------------------------------------

Thanks [~Aron.tao], i do not have strong willingness for Calcite to support 
primitive numeric type for method SqlLiteral#getValueAs, because in our code 
base, we do not have use cases like you did:
{code:java}
val tp = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT)
literal.getValueAs(tp.getJavaClass(literal.getType).asInstanceOf[java.lang.Class[_]])
{code}
So, what i'm curious and confused about is why you need the "true" typed value 
of the literal ? I think you should give us a persuasive reason, after all, 
Calcite is for all kinds of engines and use cases, we should not add a logic 
that is not common and not used even for Calcite itself.

> 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, 
> image-2019-05-17-08-23-52-735.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