[ 
https://issues.apache.org/jira/browse/SPARK-5213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reynold Xin updated SPARK-5213:
-------------------------------
    Description: 
Currently, the SQL Parser dialect is hard code in SQLContext, which is not easy 
to extend, we need the features like:

{code}
bin/spark-sql --driver-class-path customizedSQL92.jar

-- switch to "hiveql" dialect
   spark-sql>SET spark.sql.dialect=hiveql;
   spark-sql>SELECT * FROM src LIMIT 1;

-- switch to "sql" dialect
   spark-sql>SET spark.sql.dialect=sql;
   spark-sql>SELECT * FROM src LIMIT 1;

-- register the new SQL dialect
   spark-sql> SET spark.sql.dialect.sql99=com.xxx.xxx.SQL99Dialect;
   spark-sql> SET spark.sql.dialect=sql99;
   spark-sql> SELECT * FROM src LIMIT 1;

-- register the non-exist SQL dialect
   spark-sql> SET spark.sql.dialect.sql92=NotExistedClass;
   spark-sql> SET spark.sql.dialect=sql92;
   spark-sql> SELECT * FROM src LIMIT 1;
-- Exception will be thrown and switch to dialect "sql" (for SQLContext) or 
"hiveql" (for HiveContext)
{code}


  was:
Currently, the SQL Parser dialect is hard code in SQLContext, which is not easy 
to extend, we need the features like:

bin/spark-sql --driver-class-path customizedSQL92.jar

-- switch to "hiveql" dialect
   spark-sql>SET spark.sql.dialect=hiveql;
   spark-sql>SELECT * FROM src LIMIT 1;

-- switch to "sql" dialect
   spark-sql>SET spark.sql.dialect=sql;
   spark-sql>SELECT * FROM src LIMIT 1;

-- register the new SQL dialect
   spark-sql> SET spark.sql.dialect.sql99=com.xxx.xxx.SQL99Dialect;
   spark-sql> SET spark.sql.dialect=sql99;
   spark-sql> SELECT * FROM src LIMIT 1;

-- register the non-exist SQL dialect
   spark-sql> SET spark.sql.dialect.sql92=NotExistedClass;
   spark-sql> SET spark.sql.dialect=sql92;
   spark-sql> SELECT * FROM src LIMIT 1;
-- Exception will be thrown and switch to dialect "sql" (for SQLContext) or 
"hiveql" (for HiveContext)



> Pluggable SQL Parser Support
> ----------------------------
>
>                 Key: SPARK-5213
>                 URL: https://issues.apache.org/jira/browse/SPARK-5213
>             Project: Spark
>          Issue Type: New Feature
>          Components: SQL
>            Reporter: Cheng Hao
>            Assignee: Cheng Hao
>             Fix For: 1.4.0
>
>
> Currently, the SQL Parser dialect is hard code in SQLContext, which is not 
> easy to extend, we need the features like:
> {code}
> bin/spark-sql --driver-class-path customizedSQL92.jar
> -- switch to "hiveql" dialect
>    spark-sql>SET spark.sql.dialect=hiveql;
>    spark-sql>SELECT * FROM src LIMIT 1;
> -- switch to "sql" dialect
>    spark-sql>SET spark.sql.dialect=sql;
>    spark-sql>SELECT * FROM src LIMIT 1;
> -- register the new SQL dialect
>    spark-sql> SET spark.sql.dialect.sql99=com.xxx.xxx.SQL99Dialect;
>    spark-sql> SET spark.sql.dialect=sql99;
>    spark-sql> SELECT * FROM src LIMIT 1;
> -- register the non-exist SQL dialect
>    spark-sql> SET spark.sql.dialect.sql92=NotExistedClass;
>    spark-sql> SET spark.sql.dialect=sql92;
>    spark-sql> SELECT * FROM src LIMIT 1;
> -- Exception will be thrown and switch to dialect "sql" (for SQLContext) or 
> "hiveql" (for HiveContext)
> {code}



--
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