Class ParserImpl

  • All Implemented Interfaces:
    Parser

    public class ParserImpl
    extends Object
    implements Parser
    Implementation of Parser that uses Calcite.
    • Method Detail

      • parseIdentifier

        public UnresolvedIdentifier parseIdentifier​(String identifier)
        Description copied from interface: Parser
        Entry point for parsing SQL identifiers expressed as a String.
        Specified by:
        parseIdentifier in interface Parser
        Parameters:
        identifier - the SQL identifier to parse
        Returns:
        parsed identifier
      • parseSqlExpression

        public ResolvedExpression parseSqlExpression​(String sqlExpression,
                                                     RowType inputRowType,
                                                     @Nullable
                                                     LogicalType outputType)
        Description copied from interface: Parser
        Entry point for parsing SQL expressions expressed as a String.
        Specified by:
        parseSqlExpression in interface Parser
        Parameters:
        sqlExpression - the SQL expression to parse
        inputRowType - the fields available in the SQL expression
        outputType - expected top-level output type if available
        Returns:
        resolved expression
      • getCompletionHints

        public String[] getCompletionHints​(String statement,
                                           int cursor)
        Description copied from interface: Parser
        Returns completion hints for the given statement at the given cursor position. The completion happens case insensitively.
        Specified by:
        getCompletionHints in interface Parser
        Parameters:
        statement - Partial or slightly incorrect SQL statement
        cursor - cursor position
        Returns:
        completion hints that fit at the current cursor position