Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-32959][SQL][TEST] Fix an invalid test in DataSourceV2SQLSuite
### What changes were proposed in this pull request? This PR addresses two issues related to the `Relation: view text` test in `DataSourceV2SQLSuite`. 1. The test has the following block: ```scala withView("view1") { v1: String => sql(...) } ``` Since `withView`'s signature is `withView(v: String*)(f: => Unit): Unit`, the `f` that will be executed is ` v1: String => sql(..)`, which is just defining the anonymous function, and _not_ executing it. 2. Once the test is fixed to run, it actually fails. The reason is that the v2 session catalog implementation used in tests does not correctly handle `V1Table` for views in `loadTable`. And this results in views resolved to `ResolvedTable` instead of `ResolvedView`, causing the test failure: https://github.com/apache/spark/blob/f1dc479d39a6f05df7155008d8ec26dff42bb06c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L1007-L1011 ### Why are the changes needed? Fixing a bug in test. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test. Closes #29811 from imback82/fix_minor_test. Authored-by: Terry Kim <yuminkim@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information