Skip to content

Commit 2c91276

Browse files
committed
[SPARK-51743] Add describe_(database|table), show_(database|table), explain sql test and answer files
### What changes were proposed in this pull request? This PR aims to add the following test coverage. ```sql DESCRIBE DATABASE DESCRIBE TABLE EXPLAIN SHOW DATABASE SHOW TABLE ``` ### Why are the changes needed? To improve the test coverage. ### Does this PR introduce _any_ user-facing change? No, this is a test-only addition. ### How was this patch tested? Pass the CIs and do manual check. ``` $ swift test --filter SQLTests ... 􀟈 Suite SQLTests started. 􀟈 Test runAll() started. 􀟈 Test testRemoveID() started. 􁁛 Test testRemoveID() passed after 0.006 seconds. binary.sql cache.sql clear_cache.sql date.sql describe_database.sql describe_function.sql describe_query.sql describe_table.sql explain.sql floating.sql integral.sql pipesyntax.sql select.sql show_databases.sql show_tables.sql string.sql uncache.sql 􁁛 Test runAll() passed after 0.529 seconds. 􁁛 Suite SQLTests passed after 0.529 seconds. 􁁛 Test run with 2 tests passed after 0.529 seconds. ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #46 from dongjoon-hyun/SPARK-51743. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 47b6a5f commit 2c91276

11 files changed

+28
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DESCRIBE DATABASE default
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[["Catalog Name","spark_catalog"],["Namespace Name","default"],["Comment","default database"],["Location","file:\/opt\/spark\/work-dir\/spark-warehouse"],["Owner","185"]]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DESCRIBE TABLE testcache
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[["col","int",null]]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EXPLAIN EXTENDED select k, sum(v) from values (1, 2), (1, 3) t(k, v) group by k
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[["== Parsed Logical Plan ==\n'Aggregate ['k], ['k, unresolvedalias('sum('v))]\n+- SubqueryAlias t\n +- LocalRelation [k#, v#]\n\n== Analyzed Logical Plan ==\nk: int, sum(v): bigint\nAggregate [k#], [k#, sum(v#) AS sum(v)#]\n+- SubqueryAlias t\n +- LocalRelation [k#, v#]\n\n== Optimized Logical Plan ==\nAggregate [k#], [k#, sum(v#) AS sum(v)#]\n+- LocalRelation [k#, v#]\n\n== Physical Plan ==\nAdaptiveSparkPlan isFinalPlan=false\n+- HashAggregate(keys=[k#], functions=[sum(v#)], output=[k#, sum(v)#])\n +- Exchange hashpartitioning(k#, 200), ENSURE_REQUIREMENTS, [plan_id=]\n +- HashAggregate(keys=[k#], functions=[partial_sum(v#)], output=[k#, sum#])\n +- LocalTableScan [k#, v#]\n"]]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SHOW DATABASES
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[["default"]]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SHOW TABLES
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[["","testcache","true"]]

0 commit comments

Comments
 (0)