Class SqlResourceCollectorShuttle

java.lang.Object
org.apache.calcite.sql.util.SqlBasicVisitor<org.apache.calcite.sql.SqlNode>
org.apache.calcite.sql.util.SqlShuttle
org.apache.druid.sql.calcite.planner.SqlResourceCollectorShuttle
All Implemented Interfaces:
org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.sql.SqlNode>

public class SqlResourceCollectorShuttle extends org.apache.calcite.sql.util.SqlShuttle
Walks an SqlNode to collect a set of Resource for ResourceType.DATASOURCE and ResourceType.VIEW to use for authorization during query planning. It works by looking for SqlIdentifier which correspond to a IdentifierNamespace, where SqlValidatorNamespace is calcite-speak for sources of data and IdentifierNamespace specifically are namespaces which are identified by a single variable, e.g. table names.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.calcite.sql.util.SqlShuttle

    org.apache.calcite.sql.util.SqlShuttle.CallCopyingArgHandler

    Nested classes/interfaces inherited from class org.apache.calcite.sql.util.SqlBasicVisitor

    org.apache.calcite.sql.util.SqlBasicVisitor.ArgHandler<R extends Object>, org.apache.calcite.sql.util.SqlBasicVisitor.ArgHandlerImpl<R extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    SqlResourceCollectorShuttle(org.apache.calcite.sql.validate.SqlValidator validator, PlannerContext plannerContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.apache.calcite.sql.SqlNode
    visit(org.apache.calcite.sql.SqlCall call)
     
    org.apache.calcite.sql.SqlNode
    visit(org.apache.calcite.sql.SqlIdentifier id)
     

    Methods inherited from class org.apache.calcite.sql.util.SqlShuttle

    visit, visit, visit, visit, visit

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.calcite.sql.util.SqlVisitor

    visitNode
  • Constructor Details

    • SqlResourceCollectorShuttle

      public SqlResourceCollectorShuttle(org.apache.calcite.sql.validate.SqlValidator validator, PlannerContext plannerContext)
  • Method Details

    • visit

      public org.apache.calcite.sql.SqlNode visit(org.apache.calcite.sql.SqlCall call)
      Specified by:
      visit in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.sql.SqlNode>
      Overrides:
      visit in class org.apache.calcite.sql.util.SqlShuttle
    • visit

      public org.apache.calcite.sql.SqlNode visit(org.apache.calcite.sql.SqlIdentifier id)
      Specified by:
      visit in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.sql.SqlNode>
      Overrides:
      visit in class org.apache.calcite.sql.util.SqlShuttle
    • getResourceActions

      public Set<ResourceAction> getResourceActions()