val spark: org.apache.spark.sql.SparkSession = ...
spark.sessionState.sqlParser
ParserInterface — SQL Parser Contract
ParserInterface
is the parser contract for creating Expression
(to create Columns from), LogicalPlan, TableIdentifier
, and StructType for a given SQL textual representation.
Note
|
The one and only ParserInterface in Spark SQL is AbstractSqlParser.
|
ParserInterface
is available as sqlParser
in SessionState.
ParserInterface Contract
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
}
Method | Description |
---|---|
Used when… |
|
Used mainly when
|
|
Used when… |
|
Used when… |
It has the only single abstract subclass AbstractSqlParser.