cloud-fan commented on a change in pull request #24469: [SPARK-27576][SQL] 
table capability to skip the output column resolution
URL: https://github.com/apache/spark/pull/24469#discussion_r284589877
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala
 ##########
 @@ -446,6 +452,27 @@ abstract class DataSourceV2AnalysisSuite extends 
AnalysisTest {
       "Cannot safely cast", "'x'", "DoubleType to FloatType"))
   }
 
+  test("bypass output column resolution") {
+    val table = TestRelationAcceptAnySchema(StructType(Seq(
+      StructField("a", FloatType, nullable = false),
+      StructField("b", DoubleType))).toAttributes)
+
+    val query = TestRelation(StructType(Seq(
+      StructField("s", StringType))).toAttributes)
+
+    withClue("byName") {
+      val parsedPlan = byName(table, query)
+      assertResolved(parsedPlan)
+      checkAnalysis(parsedPlan, parsedPlan)
+    }
+
+    withClue("byPosition") {
 
 Review comment:
   @rdblue if 2 tests are very similar, it's recommended to use `withClue` and 
merge the 2 tests into one. For example, when the byPosition case fails, we 
will see
   ```
   bypass output column resolution *** FAILED *** (36 milliseconds)
   [info]   byPosition (DataSourceV2AnalysisSuite.scala:473)
   [info]   org.scalatest.exceptions.TestFailedException:
   ...
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to