Commit 211dd99
[SPARK-54130][SQL][FOLLOWUP] Refactor tests to use withEmptyCatalog for consistency
### What changes were proposed in this pull request?
This PR refactors two tests in `SessionCatalogSuite.scala` to use the `withEmptyCatalog` helper method instead of manually creating a `SessionCatalog` instance with `newEmptyCatalog()`:
- "UnresolvedCatalogRelation requires database in identifier"
- "HiveTableRelation requires database in identifier"
### Why are the changes needed?
**Consistency**: All other tests in `SessionCatalogSuite` use the `withEmptyCatalog` or `withBasicCatalog` helper pattern. These two tests, added in SPARK-54130, were using manual catalog initialization, which is inconsistent with the rest of the test suite.
### Does this PR introduce _any_ user-facing change?
No. This is a test-only refactoring with no functional changes.
### How was this patch tested?
- Verified no linter errors in the modified file
- The test logic remains identical, only the catalog initialization pattern changed
- Both tests validate the same assertion error messages as before
- The `withEmptyCatalog` helper handles catalog creation and cleanup automatically
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Sonnet 4.5
Closes #53208 from ganeshashree/SPARK-54130-2.
Authored-by: Ganesha S <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>1 parent 7191a14 commit 211dd99
File tree
1 file changed
+51
-51
lines changed- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog
1 file changed
+51
-51
lines changedLines changed: 51 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2095 | 2095 | | |
2096 | 2096 | | |
2097 | 2097 | | |
2098 | | - | |
2099 | | - | |
2100 | | - | |
2101 | | - | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
2102 | 2110 | | |
2103 | | - | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
2108 | | - | |
2109 | | - | |
2110 | | - | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
2111 | 2115 | | |
2112 | | - | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
2116 | 2119 | | |
2117 | | - | |
2118 | | - | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
2119 | 2124 | | |
2120 | | - | |
2121 | | - | |
2122 | | - | |
2123 | | - | |
2124 | | - | |
2125 | 2125 | | |
2126 | 2126 | | |
2127 | 2127 | | |
2128 | | - | |
2129 | | - | |
2130 | | - | |
2131 | | - | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
2132 | 2141 | | |
2133 | | - | |
2134 | | - | |
2135 | | - | |
2136 | | - | |
2137 | | - | |
2138 | | - | |
2139 | | - | |
2140 | | - | |
2141 | | - | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
2142 | 2146 | | |
2143 | | - | |
2144 | | - | |
2145 | | - | |
2146 | | - | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
2147 | 2154 | | |
2148 | | - | |
2149 | | - | |
2150 | | - | |
2151 | | - | |
2152 | | - | |
2153 | | - | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
2154 | 2159 | | |
2155 | | - | |
2156 | | - | |
2157 | | - | |
2158 | | - | |
2159 | | - | |
2160 | 2160 | | |
2161 | 2161 | | |
2162 | 2162 | | |
| |||
0 commit comments