gengliangwang commented on code in PR #52517:
URL: https://github.com/apache/spark/pull/52517#discussion_r2409509442


##########
sql/connect/server/src/test/scala/org/apache/spark/sql/connect/pipelines/PythonPipelineSuite.scala:
##########
@@ -694,6 +695,86 @@ class PythonPipelineSuite
       parameters = Map.empty)
   }
 
+  test("table with string schema") {
+    val graph = buildGraph("""
+        |from pyspark.sql.functions import lit
+        |
+        |@dp.materialized_view(schema="id LONG, name STRING")
+        |def table_with_string_schema():
+        |    return spark.range(5).withColumn("name", lit("test"))
+        |""".stripMargin)
+      .resolve()
+      .validate()
+
+    assert(graph.flows.size == 1)
+    assert(graph.tables.size == 1)
+
+    val table = graph.table(graphIdentifier("table_with_string_schema"))
+    assert(table.specifiedSchema.isDefined)

Review Comment:
   nit: shall we simply compare `table.specifiedSchema` with an expected schema 
(for example, `StructType.fromDDL(id LONG, name STRING)`)



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to