[ 
https://issues.apache.org/jira/browse/SPARK-9379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14643951#comment-14643951
 ] 

Rishi commented on SPARK-9379:
------------------------------

Thanks Michael for the reply. Precisely for plug-able SQL dialects one might 
only intend to add to existing SqlParser's functionality by extending this 
class.  Its a separate matter  to have a completely new dialect like 
HiveQLDialect. 


> org.apache.spark.sql.catalyst.SqlParser should be extensible easily 
> --------------------------------------------------------------------
>
>                 Key: SPARK-9379
>                 URL: https://issues.apache.org/jira/browse/SPARK-9379
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.4.1
>            Reporter: Rishi
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> When extending org.apache.spark.sql.catalyst.SqlParser we are usually stuck 
> with Scala limitation of not able to override lazy vals and refer super 
> values from it . (See http://www.scala-lang.org/old/node/11315.html) . This 
> can be avoided with a simple alteration to SqlPasrer.scala. See patch below.
> -  protected lazy val start: Parser[LogicalPlan] =
> -    start1 | insert | cte
> +  protected lazy val start: Parser[LogicalPlan] = allParsers
> +
> +  protected def allParsers = start1 | insert | cte
> This will allow subclasses of SqlParser to override only "allParsers" . This 
> will also ease of upgrading through spark revisions 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to