[
https://issues.apache.org/jira/browse/CALCITE-3572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
xzh_dz updated CALCITE-3572:
----------------------------
Description:
when i try to serialization and deserialization hints as below:
{code:java}
@Test public void testExplainTerms() {
String sql = "select /*+ resource(mem='20Mb') */ empno, ename from emp";
final RelNode rel = tester.convertSqlToRel(sql).rel;
RelJsonWriter jsonWriter = new RelJsonWriter();
if(rel instanceof Project) {
rel.explain(jsonWriter);
final String relJson = jsonWriter.asString();
String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson);
System.out.println(s);
}
}
{code}
{code:java}
relJson :
{
"rels": [
{
"id": "0",
"relOp": "LogicalTableScan",
"table": [
"CATALOG",
"SALES",
"EMP"
],
"inputs": []
},
{
"id": "1",
"relOp": "LogicalProject",
"fields": [
"EMPNO",
"ENAME"
],
"exprs": [
{
"input": 0,
"name": "$0"
},
{
"input": 1,
"name": "$1"
}
]
}
]
}
{code}
I find that result lack of the Hints information, maybe we should support Hints
serialization and deserialization.
was:
when i try to serialization and deserialization hints as below:
{code:java}
@Test public void testExplainTerms() {
String sql = "select /*+ resource(mem='20Mb') */ empno, ename from emp";
final RelNode rel = tester.convertSqlToRel(sql).rel;
RelJsonWriter jsonWriter = new RelJsonWriter();
if(rel instanceof Project) {
rel.explain(jsonWriter);
final String relJson = jsonWriter.asString();
String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson);
System.out.println(s);
}
}
{code}
{code:java}
{
"rels": [
{
"id": "0",
"relOp": "LogicalTableScan",
"table": [
"CATALOG",
"SALES",
"EMP"
],
"inputs": []
},
{
"id": "1",
"relOp": "LogicalProject",
"fields": [
"EMPNO",
"ENAME"
],
"exprs": [
{
"input": 0,
"name": "$0"
},
{
"input": 1,
"name": "$1"
}
]
}
]
}
{code}
I find that result lack of the Hints information, maybe we should support Hints
serialization and deserialization.
> Lack of Hints information when serialization and deserialization
> ----------------------------------------------------------------
>
> Key: CALCITE-3572
> URL: https://issues.apache.org/jira/browse/CALCITE-3572
> Project: Calcite
> Issue Type: Wish
> Reporter: xzh_dz
> Priority: Major
>
> when i try to serialization and deserialization hints as below:
> {code:java}
> @Test public void testExplainTerms() {
> String sql = "select /*+ resource(mem='20Mb') */ empno, ename from emp";
> final RelNode rel = tester.convertSqlToRel(sql).rel;
> RelJsonWriter jsonWriter = new RelJsonWriter();
> if(rel instanceof Project) {
> rel.explain(jsonWriter);
> final String relJson = jsonWriter.asString();
> String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson);
> System.out.println(s);
> }
> }
> {code}
>
> {code:java}
> relJson :
> {
> "rels": [
> {
> "id": "0",
> "relOp": "LogicalTableScan",
> "table": [
> "CATALOG",
> "SALES",
> "EMP"
> ],
> "inputs": []
> },
> {
> "id": "1",
> "relOp": "LogicalProject",
> "fields": [
> "EMPNO",
> "ENAME"
> ],
> "exprs": [
> {
> "input": 0,
> "name": "$0"
> },
> {
> "input": 1,
> "name": "$1"
> }
> ]
> }
> ]
> }
> {code}
> I find that result lack of the Hints information, maybe we should support
> Hints serialization and deserialization.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)