You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Wang Yanlin (Jira)" <ji...@apache.org> on 2019/09/16 12:40:00 UTC
[jira] [Updated] (CALCITE-3350) Keep origin type for RexLiteral
when deserialized from json string
[ https://issues.apache.org/jira/browse/CALCITE-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wang Yanlin updated CALCITE-3350:
---------------------------------
Issue Type: Bug (was: Improvement)
> 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
>
> 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.2#803003)