Class ShowTablesHandler
java.lang.Object
org.apache.drill.exec.planner.sql.handlers.AbstractSqlHandler
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler
org.apache.drill.exec.planner.sql.handlers.ShowTablesHandler
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler
DefaultSqlHandler.ConvertedRelNode, DefaultSqlHandler.MetaDataProviderModifier
-
Field Summary
Fields inherited from class org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler
config, context
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.calcite.sql.SqlNode
rewrite
(org.apache.calcite.sql.SqlNode sqlNode) Rewrite the parse tree as SELECT ...protected DefaultSqlHandler.ConvertedRelNode
validateAndConvert
(org.apache.calcite.sql.SqlNode sqlNode) Rewritten SHOW TABLES query should be executed against root schema.Methods inherited from class org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler
addRenamedProject, convertToDrel, convertToPlan, convertToPop, convertToPrel, convertToRawDrel, getPlan, getPops, log, log, log, logAndSetTextPlan, transform, transform, validateNode
Methods inherited from class org.apache.drill.exec.planner.sql.handlers.AbstractSqlHandler
unwrap
-
Constructor Details
-
ShowTablesHandler
-
-
Method Details
-
rewrite
public org.apache.calcite.sql.SqlNode rewrite(org.apache.calcite.sql.SqlNode sqlNode) throws ForemanSetupException Rewrite the parse tree as SELECT ... FROM INFORMATION_SCHEMA.`TABLES` ...- Overrides:
rewrite
in classDefaultSqlHandler
- Parameters:
sqlNode
- sql parse tree to be rewritten- Returns:
- Rewritten sql parse tree
- Throws:
ForemanSetupException
-
validateAndConvert
protected DefaultSqlHandler.ConvertedRelNode validateAndConvert(org.apache.calcite.sql.SqlNode sqlNode) throws ForemanSetupException, org.apache.calcite.tools.RelConversionException, org.apache.calcite.tools.ValidationException Rewritten SHOW TABLES query should be executed against root schema. Otherwise if query executed against, for example, jdbc plugin, returned table_schema column values won't be consistent with Drill's values for same column. Also after jdbc filter push down schema condition will be broken because it may contain name of Drill's storage plugin or name of jdbc catalog which isn't present in table_schema column.- Overrides:
validateAndConvert
in classDefaultSqlHandler
- Parameters:
sqlNode
- node produced byrewrite(SqlNode)
- Returns:
- converted rel node
- Throws:
ForemanSetupException
- when fragment setup or ser/de failedorg.apache.calcite.tools.RelConversionException
- when conversion failedorg.apache.calcite.tools.ValidationException
- when sql node validation failed
-