Uh oh!
There was an error while loading. Please reload this page.
[SPARK-5213] [SQL] Pluggable SQL Parser Support - #4015
Conversation
SparkQA
commented
Jan 13, 2015
Test build #25465 has started for PR 4015 at commit
|
OopsOutOfMemory
commented
Jan 13, 2015
nice feature. 👍 |
SparkQA
commented
Jan 13, 2015
Test build #25465 timed out for PR 4015 at commit |
AmplabJenkins
commented
Jan 13, 2015
Test FAILed. |
There was a problem hiding this comment.
This assumption may lead to some problem, an example from #3935 (comment).
There was a problem hiding this comment.
I agree with @scwf
Since our goal is to support variety sql dialects, we can not expect them all have the same behaviours so that the priority of parser is a problem.
What about leave each dialect's own implementation and abstract a method in SQLDialect to let each dialect implement their own order of parsing ?
And Sorry if I'm wrong.
There was a problem hiding this comment.
I think the difference about describe table between hive and sparksql is a known issue, we added those cases involved into blacklist in HiveCompatibilitySuite.
There was a problem hiding this comment.
Well, even if we moved the extended parser first, I don't think we want to skip the DDLParser, right? in the meantime, we have to consider the parsing fallback (once fail, we have to resort to the DDLParser) for EVERY extended parser, then, why NOT just do the fallback in DDLParser by moving it ahead of time? That's exactly the currently implementation!
And I don't think the issues @scwf described is the motive we need to update the code here, probably a better solution is we define a unified DescribeCommand logical node, and it can be casted into different execution within the context (HiveContext / SQLContext).
There was a problem hiding this comment.
Agree @chenghao-intel , we can define a unified DescribeCommand for that issue. And the order of DDLParser and sqlParser is not a big point since they cover different sql syntax range.
2fe7d99 to
336cd89CompareSparkQA
commented
Jan 14, 2015
Test build #25519 has started for PR 4015 at commit
|
SparkQA
commented
Jan 14, 2015
Test build #25519 has finished for PR 4015 at commit
|
AmplabJenkins
commented
Jan 14, 2015
Test PASSed. |
336cd89 to
4f7f626CompareSparkQA
commented
Jan 20, 2015
Test build #25803 has started for PR 4015 at commit
|
SparkQA
commented
Jan 20, 2015
Test build #25803 has finished for PR 4015 at commit
|
AmplabJenkins
commented
Jan 20, 2015
Test FAILed. |
SparkQA
commented
Jan 20, 2015
Test build #25807 has started for PR 4015 at commit
|
SparkQA
commented
Jan 20, 2015
Test build #25807 has finished for PR 4015 at commit
|
AmplabJenkins
commented
Jan 20, 2015
Test FAILed. |
SparkQA
commented
Jan 20, 2015
Test build #25808 has started for PR 4015 at commit
|
SparkQA
commented
Jan 20, 2015
Test build #25808 has finished for PR 4015 at commit
|
AmplabJenkins
commented
Jan 20, 2015
Test FAILed. |
SparkQA
commented
Jan 21, 2015
Test build #25866 has started for PR 4015 at commit
|
SparkQA
commented
Jan 21, 2015
Test build #25866 has finished for PR 4015 at commit
|
AmplabJenkins
commented
Jan 21, 2015
Test PASSed. |
c8f154d to
b0e8084CompareSparkQA
commented
Jan 22, 2015
Test build #25947 has started for PR 4015 at commit
|
SparkQA
commented
Jan 22, 2015
Test build #25947 has finished for PR 4015 at commit
|
There was a problem hiding this comment.
An abstract interface for adding a new SQL dialect. A `Dialect` is responsible for creating a logical plan from a string representation of a query. Since the `LogicalPlan` interface is not a public stable API, custom dialects will likely be tied to specific Spark releases.
Explicitly annotate this as an @DeveloperAPI.
marmbrus
commented
Apr 24, 2015
Final comments to improve user documentation. Otherwise LGTM. |
chenghao-intel
commented
Apr 27, 2015
test this please |
chenghao-intel
commented
Apr 27, 2015
retest this please |
chenghao-intel
commented
Apr 27, 2015
@liancheng@rxin@marmbrus can you trigger the unit test for me? Thanks. |
rxin
commented
Apr 27, 2015
I think Jenkins is having some trouble right now. |
rxin
commented
Apr 27, 2015
Jenkins, retest this please. |
1 similar comment
chenghao-intel
commented
Apr 28, 2015
Jenkins, retest this please. |
SparkQA
commented
Apr 28, 2015
Test build #31088 has started for PR 4015 at commit |
SparkQA
commented
Apr 28, 2015
Test build #31088 has finished for PR 4015 at commit
|
chenghao-intel
commented
Apr 28, 2015
cc @marmbrus |
marmbrus
commented
May 1, 2015
Thanks, merged to master. |
scwf
commented
May 1, 2015
based on #4015, we should not delete `sqlParser` from sqlcontext, that leads to mima failed. Users implement dialect to give a fallback for `sqlParser` and we should construct `sqlParser` in sqlcontext according to the dialect `protected[sql] val sqlParser = new SparkSQLParser(getSQLDialect().parse(_))` Author: Cheng Hao <hao.cheng@intel.com> Author: scwf <wangfei1@huawei.com> Closes#5827 from scwf/sqlparser1 and squashes the following commits: 81b9737 [scwf] comment fix 0878bd1 [scwf] remove comments c19780b [scwf] fix mima tests c2895cf [scwf] Merge branch 'master' of https://github.com/apache/spark into sqlparser1 493775c [Cheng Hao] update the code as feedback 81a731f [Cheng Hao] remove the unecessary comment aab0b0b [Cheng Hao] polish the code a little bit 49b9d81 [Cheng Hao] shrink the comment for rebasing
This PR aims to make the SQL Parser Pluggable, and user can register it's own parser via Spark SQL CLI.
```
# add the jar into the classpath
$hchengmydesktop:spark>bin/spark-sql --jars sql99.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;
-- switch to a custom dialect
spark-sql>SET spark.sql.dialect=com.xxx.xxx.SQL99Dialect;
spark-sql>SELECT * FROM src LIMIT 1;
-- register the non-exist SQL dialect
spark-sql> SET spark.sql.dialect=NotExistedClass;
spark-sql> SELECT * FROM src LIMIT 1;
-- Exception will be thrown and switch to default sql dialect ("sql" for SQLContext and "hiveql" for HiveContext)
```
Author: Cheng Hao <hao.cheng@intel.com>
Closesapache#4015 from chenghao-intel/sqlparser and squashes the following commits:
493775c [Cheng Hao] update the code as feedback
81a731f [Cheng Hao] remove the unecessary comment
aab0b0b [Cheng Hao] polish the code a little bit
49b9d81 [Cheng Hao] shrink the comment for rebasingbased on apache#4015, we should not delete `sqlParser` from sqlcontext, that leads to mima failed. Users implement dialect to give a fallback for `sqlParser` and we should construct `sqlParser` in sqlcontext according to the dialect `protected[sql] val sqlParser = new SparkSQLParser(getSQLDialect().parse(_))` Author: Cheng Hao <hao.cheng@intel.com> Author: scwf <wangfei1@huawei.com> Closesapache#5827 from scwf/sqlparser1 and squashes the following commits: 81b9737 [scwf] comment fix 0878bd1 [scwf] remove comments c19780b [scwf] fix mima tests c2895cf [scwf] Merge branch 'master' of https://github.com/apache/spark into sqlparser1 493775c [Cheng Hao] update the code as feedback 81a731f [Cheng Hao] remove the unecessary comment aab0b0b [Cheng Hao] polish the code a little bit 49b9d81 [Cheng Hao] shrink the comment for rebasing
This PR aims to make the SQL Parser Pluggable, and user can register it's own parser via Spark SQL CLI.
```
# add the jar into the classpath
$hchengmydesktop:spark>bin/spark-sql --jars sql99.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;
-- switch to a custom dialect
spark-sql>SET spark.sql.dialect=com.xxx.xxx.SQL99Dialect;
spark-sql>SELECT * FROM src LIMIT 1;
-- register the non-exist SQL dialect
spark-sql> SET spark.sql.dialect=NotExistedClass;
spark-sql> SELECT * FROM src LIMIT 1;
-- Exception will be thrown and switch to default sql dialect ("sql" for SQLContext and "hiveql" for HiveContext)
```
Author: Cheng Hao <hao.cheng@intel.com>
Closesapache#4015 from chenghao-intel/sqlparser and squashes the following commits:
493775c [Cheng Hao] update the code as feedback
81a731f [Cheng Hao] remove the unecessary comment
aab0b0b [Cheng Hao] polish the code a little bit
49b9d81 [Cheng Hao] shrink the comment for rebasingbased on apache#4015, we should not delete `sqlParser` from sqlcontext, that leads to mima failed. Users implement dialect to give a fallback for `sqlParser` and we should construct `sqlParser` in sqlcontext according to the dialect `protected[sql] val sqlParser = new SparkSQLParser(getSQLDialect().parse(_))` Author: Cheng Hao <hao.cheng@intel.com> Author: scwf <wangfei1@huawei.com> Closesapache#5827 from scwf/sqlparser1 and squashes the following commits: 81b9737 [scwf] comment fix 0878bd1 [scwf] remove comments c19780b [scwf] fix mima tests c2895cf [scwf] Merge branch 'master' of https://github.com/apache/spark into sqlparser1 493775c [Cheng Hao] update the code as feedback 81a731f [Cheng Hao] remove the unecessary comment aab0b0b [Cheng Hao] polish the code a little bit 49b9d81 [Cheng Hao] shrink the comment for rebasing
This PR aims to make the SQL Parser Pluggable, and user can register it's own parser via Spark SQL CLI.
```
# add the jar into the classpath
$hchengmydesktop:spark>bin/spark-sql --jars sql99.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;
-- switch to a custom dialect
spark-sql>SET spark.sql.dialect=com.xxx.xxx.SQL99Dialect;
spark-sql>SELECT * FROM src LIMIT 1;
-- register the non-exist SQL dialect
spark-sql> SET spark.sql.dialect=NotExistedClass;
spark-sql> SELECT * FROM src LIMIT 1;
-- Exception will be thrown and switch to default sql dialect ("sql" for SQLContext and "hiveql" for HiveContext)
```
Author: Cheng Hao <hao.cheng@intel.com>
Closesapache#4015 from chenghao-intel/sqlparser and squashes the following commits:
493775c [Cheng Hao] update the code as feedback
81a731f [Cheng Hao] remove the unecessary comment
aab0b0b [Cheng Hao] polish the code a little bit
49b9d81 [Cheng Hao] shrink the comment for rebasingbased on apache#4015, we should not delete `sqlParser` from sqlcontext, that leads to mima failed. Users implement dialect to give a fallback for `sqlParser` and we should construct `sqlParser` in sqlcontext according to the dialect `protected[sql] val sqlParser = new SparkSQLParser(getSQLDialect().parse(_))` Author: Cheng Hao <hao.cheng@intel.com> Author: scwf <wangfei1@huawei.com> Closesapache#5827 from scwf/sqlparser1 and squashes the following commits: 81b9737 [scwf] comment fix 0878bd1 [scwf] remove comments c19780b [scwf] fix mima tests c2895cf [scwf] Merge branch 'master' of https://github.com/apache/spark into sqlparser1 493775c [Cheng Hao] update the code as feedback 81a731f [Cheng Hao] remove the unecessary comment aab0b0b [Cheng Hao] polish the code a little bit 49b9d81 [Cheng Hao] shrink the comment for rebasing
This PR aims to make the SQL Parser Pluggable, and user can register it's own parser via Spark SQL CLI.