SQL Parser Framework in Spark SQL uses ANTLR to translate a SQL text to a data type, Expression, TableIdentifier or LogicalPlan.
The contract of the SQL Parser Framework is described by ParserInterface contract. The contract is then abstracted in AbstractSqlParser class so subclasses have to provide custom AstBuilder only.
There are two concrete implementations of AbstractSqlParser:
SparkSqlParser that is the default parser of the SQL expressions into Spark’s types.
CatalystSqlParser that is used to parse data types from their canonical string representation.