ParserInterface — SQL Parser Contract
ParserInterface
is the contract of SQL parsers that can parse Expressions, LogicalPlans, TableIdentifiers, and StructTypes given the textual representation of SQL statements.
1 2 3 4 5 6 7 8 9 10 11 12 |
package org.apache.spark.sql.catalyst.parser trait ParserInterface { def parseExpression(sqlText: String): Expression def parsePlan(sqlText: String): LogicalPlan def parseTableIdentifier(sqlText: String): TableIdentifier def parseTableSchema(sqlText: String): StructType } |
Note
|
AbstractSqlParser is the one and only known extension of the ParserInterface Contract in Spark SQL.
|
ParserInterface
is available as sqlParser
in SessionState.
1 2 3 4 5 6 7 8 9 |
scala> :type spark org.apache.spark.sql.SparkSession scala> :type spark.sessionState.sqlParser org.apache.spark.sql.catalyst.parser.ParserInterface |
Method | Description |
---|---|
|
Parses a SQL text to an Expression Used in the following:
|
|
Parses a SQL text to a LogicalPlan Used when:
|
|
Used when:
|
|
Parses a SQL text to a StructType Used when:
|