@@ -69,16 +69,16 @@ Explain query
6969``` bash ppl
7070curl -sS -H ' Content-Type: application/json' \
7171-X POST localhost:9200/_plugins/_ppl/_explain \
72- -d ' {"query" : "source=state_country | where age>30"}'
72+ -d ' {"query" : "source=state_country | where age>30 | fields name, country, state, month, year, age "}'
7373```
7474
7575Expected output:
7676
7777``` json
7878{
7979 "calcite" : {
80- "logical" : " LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0 ], country=[$1 ], state=[$2 ], month=[$3 ], year=[$4 ], age=[$5])\n LogicalFilter(condition=[>($5, 30)])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n " ,
81- "physical" : " CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year , age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={\" from\" :0,\" size\" :10000,\" timeout\" :\" 1m\" ,\" query\" :{\" range\" :{\" age\" :{\" from\" :30,\" to\" :null,\" include_lower\" :false,\" include_upper\" :true,\" boost\" :1.0}}},\" _source\" :{\" includes\" :[\" name\" ,\" country\" ,\" state\" ,\" month\" ,\" year\" ,\" age\" ],\" excludes\" :[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])\n "
80+ "logical" : " LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$3 ], country=[$0 ], state=[$4 ], month=[$1 ], year=[$2 ], age=[$5])\n LogicalFilter(condition=[>($5, 30)])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n " ,
81+ "physical" : " CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[country, month, year, name, state , age], FILTER->>($5, 30), PROJECT->[name, country, state, month, year, age] , LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={\" from\" :0,\" size\" :10000,\" timeout\" :\" 1m\" ,\" query\" :{\" range\" :{\" age\" :{\" from\" :30,\" to\" :null,\" include_lower\" :false,\" include_upper\" :true,\" boost\" :1.0}}},\" _source\" :{\" includes\" :[\" name\" ,\" country\" ,\" state\" ,\" month\" ,\" year\" ,\" age\" ],\" excludes\" :[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])\n "
8282 }
8383}
8484
@@ -91,7 +91,7 @@ Explain query
9191``` bash ppl
9292curl -sS -H ' Content-Type: application/json' \
9393-X POST localhost:9200/_plugins/_ppl/_explain? format=simple \
94- -d ' {"query" : "source=state_country | where age>30"}'
94+ -d ' {"query" : "source=state_country | where age>30 | fields name, country, state, month, year, age "}'
9595```
9696
9797Expected output:
@@ -111,16 +111,16 @@ Explain query
111111``` bash ppl
112112curl -sS -H ' Content-Type: application/json' \
113113-X POST localhost:9200/_plugins/_ppl/_explain? format=extended \
114- -d ' {"query" : "source=state_country | where age>30"}'
114+ -d ' {"query" : "source=state_country | where age>30 | fields name, country, state, month, year, age "}'
115115```
116116
117117Expected output:
118118
119119``` json
120120{
121121 "calcite" : {
122- "logical" : " LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0 ], country=[$1 ], state=[$2 ], month=[$3 ], year=[$4 ], age=[$5])\n LogicalFilter(condition=[>($5, 30)])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n " ,
123- "physical" : " CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year , age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={\" from\" :0,\" size\" :10000,\" timeout\" :\" 1m\" ,\" query\" :{\" range\" :{\" age\" :{\" from\" :30,\" to\" :null,\" include_lower\" :false,\" include_upper\" :true,\" boost\" :1.0}}},\" _source\" :{\" includes\" :[\" name\" ,\" country\" ,\" state\" ,\" month\" ,\" year\" ,\" age\" ],\" excludes\" :[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])\n " ,
122+ "logical" : " LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$3 ], country=[$0 ], state=[$4 ], month=[$1 ], year=[$2 ], age=[$5])\n LogicalFilter(condition=[>($5, 30)])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n " ,
123+ "physical" : " CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[country, month, year, name, state , age], FILTER->>($5, 30), PROJECT->[name, country, state, month, year, age] , LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={\" from\" :0,\" size\" :10000,\" timeout\" :\" 1m\" ,\" query\" :{\" range\" :{\" age\" :{\" from\" :30,\" to\" :null,\" include_lower\" :false,\" include_upper\" :true,\" boost\" :1.0}}},\" _source\" :{\" includes\" :[\" name\" ,\" country\" ,\" state\" ,\" month\" ,\" year\" ,\" age\" ],\" excludes\" :[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])\n " ,
124124 "extended" : " public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root) {\n final org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan v1stashed = (org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan) root.get(\" v1stashed\" );\n return v1stashed.scan();\n }\n\n\n public Class getElementType() {\n return java.lang.Object[].class;\n }\n\n\n "
125125 }
126126}
@@ -136,7 +136,7 @@ Explain query
136136``` bash ppl
137137curl -sS -H ' Content-Type: application/json' \
138138-X POST localhost:9200/_plugins/_ppl/_explain? format=yaml \
139- -d ' {"query" : "source=state_country | where age>30"}'
139+ -d ' {"query" : "source=state_country | where age>30 | fields name, country, state, month, year, age "}'
140140```
141141
142142Expected output:
@@ -145,10 +145,10 @@ Expected output:
145145calcite :
146146 logical : |
147147 LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])
148- LogicalProject(name=[$0 ], country=[$1 ], state=[$2 ], month=[$3 ], year=[$4 ], age=[$5])
148+ LogicalProject(name=[$3 ], country=[$0 ], state=[$4 ], month=[$1 ], year=[$2 ], age=[$5])
149149 LogicalFilter(condition=[>($5, 30)])
150150 CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])
151151 physical : |
152- CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year , age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10000,"timeout":"1m","query":{"range":{"age":{"from":30,"to":null,"include_lower":false,"include_upper":true,"boost":1.0}}},"_source":{"includes":["name","country","state","month","year","age"],"excludes":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])
152+ CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[country, month, year, name, state , age], FILTER->>($5, 30), PROJECT->[name, country, state, month, year, age] , LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10000,"timeout":"1m","query":{"range":{"age":{"from":30,"to":null,"include_lower":false,"include_upper":true,"boost":1.0}}},"_source":{"includes":["name","country","state","month","year","age"],"excludes":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])
153153` ` `
154154
0 commit comments