GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/14235
[SPARK-16590][SQL][TEST] Improve LogicalPlanToSQLSuite to check generated
SQL directly
## What changes were proposed in this pull request?
This issue improves `LogicalPlanToSQLSuite` to check the generated SQL
directly by **structure**. So far, `LogicalPlanToSQLSuite` relies on
`checkHiveQl` to ensure the **successful SQL generation** and **answer
equality**. However, it does not guarantee the generated SQL is the same or
will not be changed unnoticeabley.
The following is an example result of this issue.
```scala
- checkHiveQl("SELECT * FROM parquet_t0 TABLESAMPLE(0.1 PERCENT) WHERE
1=0")
+ checkHiveQl("SELECT * FROM parquet_t0 TABLESAMPLE(0.1 PERCENT) WHERE
1=0",
+ """
+ |SELECT `gen_attr` AS `id`
+ |FROM (SELECT `gen_attr`
+ | FROM (SELECT `id` AS `gen_attr`
+ | FROM `default`.`parquet_t0`
+ | TABLESAMPLE(0.1 PERCENT))
+ | AS gen_subquery_0
+ | WHERE (1 = 0))
+ | AS parquet_t0
+ """.stripMargin)
```
## How was this patch tested?
Pass the Jenkins. This is only a testsuite change.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-16590
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14235.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14235
----
commit a3bb306af576834d93394d4ac636c5b52b6d745a
Author: Dongjoon Hyun <[email protected]>
Date: 2016-07-17T01:39:18Z
[SPARK-16590][SQL] Improve LogicalPlanToSQLSuite to check generated SQL
directly
----
---
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]