Class CompoundIdentifierConverter

java.lang.Object
org.apache.calcite.sql.util.SqlBasicVisitor<org.apache.calcite.sql.SqlNode>
org.apache.calcite.sql.util.SqlShuttle
org.apache.drill.exec.planner.sql.parser.CompoundIdentifierConverter
All Implemented Interfaces:
org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.sql.SqlNode>

public class CompoundIdentifierConverter extends org.apache.calcite.sql.util.SqlShuttle
Implementation of SqlVisitor that converts bracketed compound SqlIdentifier to bracket-less compound SqlIdentifier (also known as DrillCompoundIdentifier) to provide ease of use while querying complex types.

For example, this visitor converts a['b'][4]['c'] to a.b[4].c

  • 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
    CompoundIdentifierConverter(boolean allowNoTableRefCompoundIdentifier)
     
  • 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

    • CompoundIdentifierConverter

      public CompoundIdentifierConverter(boolean allowNoTableRefCompoundIdentifier)
  • Method Details

    • 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
    • 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