Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/2513#discussion_r18436541
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SqlParser.scala ---
@@ -183,17 +184,15 @@ class SqlParser extends StandardTokenParsers with
PackratParsers {
}
protected lazy val cache: Parser[LogicalPlan] =
- CACHE ~ TABLE ~> ident ~ opt(AS ~> select) <~ opt(";") ^^ {
- case tableName ~ None =>
- CacheCommand(tableName, true)
- case tableName ~ Some(plan) =>
- CacheTableAsSelectCommand(tableName, plan)
+ CACHE ~> opt(LAZY) ~ (TABLE ~> ident) ~ opt(AS ~> select) <~ opt(";")
^^ {
--- End diff --
We have been using the `opt` style, but only because I didn't know about
the other one.
Also we can probably omit the `;` handling. It is not supported by any of
the other parsers.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]