Interface CommandHandler

All Known Implementing Classes:
AlterCommandHandler, BeginEndBlockHandler, ColumnDefinitionParser, CommentCommandHandler, CreateInfrastructureHandler, CreateNamespaceHandler, CreateRelationalHandler, CreateRoutineHandler, CreateSecurityHandler, CreateTableHandler, DDLCommandHandler, DMLCommandHandler, DropCommandHandler, GrantRevokeHandler, QueryCommandHandler, ShowCommandHandler

public interface CommandHandler
Base interface for SQL command handlers
  • Method Details

    • getText

      Get text from identifier or qualified name context
      Parameters:
      ctx - the identifier parse tree
      Returns:
      the canonical name — unquoted identifiers folded to upper case, quoted ones verbatim
    • getText

    • qualifiedNameParts

      default String[] qualifiedNameParts(FrostlakeParser.QualifiedNameContext ctx)
      The identifier parts of a qualified name (db, schema, name), read from the parse tree instead of by splitting its flattened text on '.' — correct even for a quoted identifier containing a dot.
      Parameters:
      ctx - the qualified-name parse tree
      Returns:
      the canonical name parts in source order, one element per dotted level
    • extractComment

      default String extractComment(FrostlakeParser.CommentClauseContext ctx)
      Extract comment from comment clause
      Parameters:
      ctx - the COMMENT [=] '<text>' clause, or null when the statement carries none
      Returns:
      the comment text with its single-quote or dollar-quote delimiters stripped, or null when the clause is absent
    • extractComment

      default String extractComment(FrostlakeParser.ColumnCommentClauseContext ctx)
      The COLUMN-level flavour of extractComment(FrostlakeParser.CommentClauseContext) — COMMENT '<text>' with no equals sign, the only spelling live accepts on a column.
      Parameters:
      ctx - the column's comment clause, or null when the column carries none
      Returns:
      the comment text with its single-quote or dollar-quote delimiters stripped, or null when the clause is absent
    • getCatalog

      Catalog getCatalog()
      Get catalog instance
      Returns:
      the engine's metastore catalog, holding the objects this handler reads and mutates
    • getQueryExecutor

      QueryExecutor getQueryExecutor()
      Get query executor instance
      Returns:
      the engine's query executor, for handlers that run nested queries or need session state