Description
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 and will not be changed unnoticeably.
The following is an example result of this issue.
- 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)
Attachments
Issue Links
- is related to
-
SPARK-16576 Move plan SQL generation code from SQLBuilder into logical operators
-
- Closed
-
- relates to
-
SPARK-16475 Broadcast Hint for SQL Queries
-
- Resolved
-
- links to