dtenedor commented on code in PR #46451:
URL: https://github.com/apache/spark/pull/46451#discussion_r1594743832


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/python/PythonUDTFSuite.scala:
##########
@@ -363,4 +364,29 @@ class PythonUDTFSuite extends QueryTest with 
SharedSparkSession {
         Row("abc"))
     }
   }
+
+  test("SPARK-48180: Analyzer bug with multiple ORDER BY items for input table 
argument") {
+    assume(shouldTestPythonUDFs)
+    spark.udtf.registerPython("testUDTF", pythonUDTF)
+    checkError(
+      exception = intercept[ParseException](sql(
+        """
+          |SELECT * FROM testUDTF(
+          |  TABLE(SELECT 1 AS device_id, 2 AS data_ds)
+          |  WITH SINGLE PARTITION
+          |  ORDER BY device_id, data_ds)

Review Comment:
   Yes, that should be the correct syntax.
   Interesting idea...trying this out with some simple and complex cases, I am 
a bit scared to copy/paste the entire provided ORDER BY clause into the error 
message since it could be very long if there are many columns/complex 
expressions. But the new error message specifically indicates to add 
parentheses around the expressions, it should be pretty clear (see L381-L384 
below).



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to