[ https://issues.apache.org/jira/browse/CALCITE-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wang Yanlin closed CALCITE-3350. -------------------------------- Resolution: Not A Problem > Keep origin type for RexLiteral when deserialized from json string > ------------------------------------------------------------------ > > Key: CALCITE-3350 > URL: https://issues.apache.org/jira/browse/CALCITE-3350 > Project: Calcite > Issue Type: Bug > Reporter: Wang Yanlin > Priority: Minor > Labels: pull-request-available > Time Spent: 2h > Remaining Estimate: 0h > > The json string of sql > {noformat} > select ename from emp where job = "abd" > {noformat} > is > {noformat} > { > "rels": [ > { > "id": "0", > "relOp": "LogicalTableScan", > "table": [ > "scott", > "EMP" > ], > "inputs": [] > }, > { > "id": "1", > "relOp": "LogicalFilter", > "condition": { > "op": { > "name": "=", > "kind": "EQUALS", > "syntax": "BINARY" > }, > "operands": [ > { > "input": 2, > "name": "$2" > }, > { > "literal": "abd", > "type": { > "type": "VARCHAR", > "nullable": false, > "precision": 10 > } > } > ] > } > }, > { > "id": "2", > "relOp": "LogicalProject", > "fields": [ > "ENAME" > ], > "exprs": [ > { > "input": 1, > "name": "$1" > } > ] > } > ] > } > {noformat} > The original type of literal "abd" is > {noformat} > VARCHAR(10) NOT NULL > {noformat} > When deserialized relnode from this json string, the type of literal "abd" is > changed to > {noformat} > CHAR(3) NOT NULL > {noformat} > Better to keep the same with original type when deserialized from string. -- This message was sent by Atlassian Jira (v8.3.4#803005)