Wang Yanlin created CALCITE-3295:
------------------------------------

             Summary: Aggregate call name lost in serialized json string.
                 Key: CALCITE-3295
                 URL: https://issues.apache.org/jira/browse/CALCITE-3295
             Project: Calcite
          Issue Type: Bug
            Reporter: Wang Yanlin


When serialize a relnode to json string, the name of aggregate call was lost.
 For a sql string like this
{code:java}
SELECT max(SAL) as max_sal from EMP group by JOB;
{code}
The serialized json string is like this
{code:java}
{
  "rels": [
    {
      "id": "0",
      "relOp": "LogicalTableScan",
      "table": [
        "scott",
        "EMP"
      ],
      "inputs": []
    },
    {
      "id": "1",
      "relOp": "LogicalProject",
      "fields": [
        "JOB",
        "SAL"
      ],
      "exprs": [
        {
          "input": 2,
          "name": "$2"
        },
        {
          "input": 5,
          "name": "$5"
        }
      ]
    },
    {
      "id": "2",
      "relOp": "LogicalAggregate",
      "group": [
        0
      ],
      "aggs": [
        {
          "agg": {
            "name": "MAX",
            "kind": "MAX",
            "syntax": "FUNCTION"
          },
          "type": {
            "type": "DECIMAL",
            "nullable": true,
            "precision": 7,
            "scale": 2
          },
          "distinct": false,
          "operands": [
            1
          ],
        }
      ]
    },
    {
      "id": "3",
      "relOp": "LogicalProject",
      "fields": [
        "max_sal"
      ],
      "exprs": [
        {
          "input": 1,
          "name": "$1"
        }
      ]
    }
  ]
}
{code}
Lost the name of max call.





--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to