ulysses-you commented on a change in pull request #1085:
URL: https://github.com/apache/incubator-kyuubi/pull/1085#discussion_r711470504
##########
File path:
dev/kyuubi-extension-spark-3-1/src/test/scala/org/apache/spark/sql/KyuubiExtensionSuite.scala
##########
@@ -1303,4 +1303,96 @@ class KyuubiExtensionSuite extends
KyuubiSparkSQLExtensionTest {
}
}
}
+
+ test("test watchdog with query forceMaxOutputRows") {
+
+ withSQLConf(KyuubiSQLConf.WATCHDOG_FORCED_MAXOUTPUTROWS.key -> "10") {
+
+ assert(sql("SELECT * FROM VALUES(1, 'a'),(2, 'b') AS t(c1, c2)")
+ .queryExecution.analyzed.isInstanceOf[GlobalLimit])
+
+ assert(sql("SELECT * FROM VALUES(1, 'a'),(2, 'b') AS t(c1, c2) LIMIT 1")
+ .queryExecution.analyzed.asInstanceOf[GlobalLimit].maxRows.contains(1))
+
+ assert(sql("SELECT * FROM VALUES(1, 'a'),(2, 'b') AS t(c1, c2) LIMIT 11")
+
.queryExecution.analyzed.asInstanceOf[GlobalLimit].maxRows.contains(10))
+
+ assert(!sql("SELECT count(*) FROM VALUES(1, 'a'),(2, 'b') AS t(c1, c2)")
+ .queryExecution.analyzed.isInstanceOf[GlobalLimit])
+
+ assert(sql(
+ """
+ |SELECT c1, COUNT(*)
+ |FROM VALUES(1, 'a'), (2, 'b') AS t(c1, c2)
+ |GROUP BY c1
+ |""".stripMargin).queryExecution.analyzed.isInstanceOf[GlobalLimit])
Review comment:
This query used the plan `LocalRelation` and after 3.2.0 the
`LocalRelation`'s maxRows will be the data size. That said, if you have a query
`SELECT * FROM VALUES(1, 'a'), (2, 'b') AS t(c1, c2)`, the root Project node
maxRows will be `Some(2)` instead of `None`. Then the test will fail if we
switch the Spark version from 3.1 to 3.2.
--
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]