Interface Parser

  • All Known Implementing Classes:
    ParserImpl

    @PublicEvolving
    public interface Parser
    Provides methods for parsing SQL objects from a SQL string.
    • Method Detail

      • parse

        List<Operation> parse​(String statement)
        Entry point for parsing SQL queries expressed as a String.

        Note:If the created Operation is a QueryOperation it must be in a form that will be understood by the Planner.translate(List) method.

        The produced Operation trees should already be validated.

        Parameters:
        statement - the SQL statement to evaluate
        Returns:
        parsed queries as trees of relational Operations
        Throws:
        SqlParserException - when failed to parse the statement
      • parseIdentifier

        UnresolvedIdentifier parseIdentifier​(String identifier)
        Entry point for parsing SQL identifiers expressed as a String.
        Parameters:
        identifier - the SQL identifier to parse
        Returns:
        parsed identifier
        Throws:
        SqlParserException - when failed to parse the identifier
      • parseSqlExpression

        ResolvedExpression parseSqlExpression​(String sqlExpression,
                                              RowType inputRowType,
                                              @Nullable
                                              LogicalType outputType)
        Entry point for parsing SQL expressions expressed as a String.
        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
        Throws:
        SqlParserException - when failed to parse the sql expression
      • getCompletionHints

        String[] getCompletionHints​(String statement,
                                    int position)
        Returns completion hints for the given statement at the given cursor position. The completion happens case insensitively.
        Parameters:
        statement - Partial or slightly incorrect SQL statement
        position - cursor position
        Returns:
        completion hints that fit at the current cursor position