You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include a list of warnings in the explain (TYPE IO) output.
Currently in our production environment run explain(TYPE IO) before executing a query and use the result as input to our routing decisions. As part of getting the IO info, EXPLAIN (TYPE IO) generates the query plan, and therefore also has additional information about the planner warnings for the query. Include the warning information in the explain output as well so we can take advantage of the computation that has already been done in the original explain.
We can gate this by a session property include_warnings_in_explain_io_output
Expected Behavior or Use Case
Current behavior:
presto> EXPLAIN (TYPE IO) SELECT * FROM (SELECT * FROM tpch.sf1.nation order by n_nationkey) order by n_regionkey;
Query Plan
---------------------------------
{
"inputTableColumnInfos" : [ {
"table" : {
"catalog" : "tpch",
"schemaTable" : {
"schema" : "sf1.0",
"table" : "nation"
}
},
"columnConstraints" : [ ]
} ]
}
New result:
presto> EXPLAIN (TYPE IO) SELECT * FROM (SELECT * FROM tpch.sf1.nation order by n_nationkey) order by n_regionkey;
Query Plan
---------------------------------
{
"inputTableColumnInfos" : [ {
"table" : {
"catalog" : "tpch",
"schemaTable" : {
"schema" : "sf1.0",
"table" : "nation"
}
},
"columnConstraints" : [ ]
} ],
"warnings": [ {
"warningCode" : {
"code" : 5,
"name" : "REDUNDANT_ORDER_BY"
},
"message" : "ORDER BY in subquery may have no effect"
} ]
}
Presto Component, Service, or Connector
coordinator
Possible Implementation
Pass the warning collector from QueryExplainer into the IoPlanPrinter and then add the warnings to the explain output.
Example Screenshots (if appropriate):
Context
We plan to add custom warnings based on features supported in our different environments. We want to be able to use those warnings as input to our query routing decisions to determine which environment to route a query to. We'd like to reduce overhead by taking advantage of the explain(TYPE IO) that we are already calling and that is already getting this information.
The text was updated successfully, but these errors were encountered:
Include a list of warnings in the explain (TYPE IO) output.
Currently in our production environment run explain(TYPE IO) before executing a query and use the result as input to our routing decisions. As part of getting the IO info, EXPLAIN (TYPE IO) generates the query plan, and therefore also has additional information about the planner warnings for the query. Include the warning information in the explain output as well so we can take advantage of the computation that has already been done in the original explain.
We can gate this by a session property include_warnings_in_explain_io_output
Expected Behavior or Use Case
Current behavior:
New result:
Presto Component, Service, or Connector
coordinator
Possible Implementation
Pass the warning collector from QueryExplainer into the IoPlanPrinter and then add the warnings to the explain output.
Example Screenshots (if appropriate):
Context
We plan to add custom warnings based on features supported in our different environments. We want to be able to use those warnings as input to our query routing decisions to determine which environment to route a query to. We'd like to reduce overhead by taking advantage of the explain(TYPE IO) that we are already calling and that is already getting this information.
The text was updated successfully, but these errors were encountered: