SQLContext.executeSql
SQLContext.parseSql
DDLParser//先用DDL解析器解析
SparkSQLParser//用于"create table from select clause"形式的DDL语句中解析"select clause"
SparkSQLParser//如果DDL解析器结果为空,则用此顶层sql解析器解析
AbstractSparkSQLParser.apply
SqlLexical.initialize//收集所有用KEYWORD对象作为保留关键字
SqlLexical.Scanner
PackratParsers.phase
start//使用SparkSQLParser中重写的start变量
cache
CacheTableCommand//进入spark特定的非sql语法识别
uncache
UncacheTableCommand
set
SetCommandParser
show
ShowTablesCommand
others
SqlParser//
AbstractSparkSQLParser.apply
SqlLexical.initialize//收集所有用KEYWORD对象作为保留关键字
SqlLexical.Scanner
PackratParsers.phase
start//使用SqlParser中重写的start变量
select//进入select语法识别
SELECT
repsep(project)//把投影节点识别为表达式Parser[Expression]
FROM
relations
relation
relationFactor
UnresolvedRelation//至此识别出第一个逻辑执行计划节点Parser[LogicalPlan]
UNION//进入多语句的union语法识别
insert//进入insert语句识别
SQLContext.executeSql