[ https://issues.apache.org/jira/browse/CALCITE-3065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16853913#comment-16853913 ]
Jiatao Tao edited comment on CALCITE-3065 at 6/2/19 8:20 AM: ------------------------------------------------------------- Hi [~julianhyde] I can buy in your thoughts about null scenario. But the code below, is all Calcite' API, and `tp.getJavaClass(literal.getType)` returns int not Integer(`type.isNullable` return false.). val tp = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT) literal.getValueAs(tp.getJavaClass(literal.getType).asInstanceOf[java.lang.Class[_]]) !image-2019-06-02-08-15-35-460.png! My point is `JavaTypeFactoryImpl#getJavaClass` may return primitive type(means type is not nullable), shouldn't we consider primitive type in `getValueAs`? Or am I use the API in a wrong way? Hope for your opinion, thanks was (Author: aron.tao): Hi [~julianhyde] I can buy in your thoughts about null scenario. But the code below, is all Calcite' API, and `tp.getJavaClass(literal.getType)` returns int not Integer(`type.isNullable` return false.). val tp = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT) literal.getValueAs(tp.getJavaClass(literal.getType).asInstanceOf[java.lang.Class[_]]) !image-2019-06-02-08-15-35-460.png! My point is `JavaTypeFactoryImpl#getJavaClass` may return primitive type(means type is not nullable), shouldn't we consider primitive type in `getValueAs`? > 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, image-2019-06-02-08-15-35-460.png > > Time Spent: 40m > Remaining Estimate: 0h > > !image-2019-05-13-12-04-36-365.png! -- This message was sent by Atlassian JIRA (v7.6.3#76005)