MaxGekk commented on code in PR #44535:
URL: https://github.com/apache/spark/pull/44535#discussion_r1439234100
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/DescribeTableSuite.scala:
##########
@@ -196,4 +199,20 @@ class DescribeTableSuite extends
command.DescribeTableSuiteBase
Row("comment", "column_comment")))
}
}
+
+ test("describe extended table with stats") {
+ withNamespaceAndTable("ns", "tbl") { tbl =>
+ sql(
+ s"""
+ |CREATE TABLE $tbl
+ |(key INT, col STRING)
+ |$defaultUsing""".stripMargin)
+
+ sql(s"INSERT INTO $tbl values (1, 'aaa'), (2, 'bbb'), (3, 'ccc'), (null,
'ddd')")
+ val descriptionDf = sql(s"DESCRIBE TABLE EXTENDED $tbl")
+ val stats = descriptionDf.filter("col_name ==
'Statistics'").select("data_type")
+ .collectAsList().get(0).toString
+ Assertions.assertTrue("""\[\d+\s+bytes,\s+4\s+rows]""".r.matches(stats))
Review Comment:
```suggestion
assert("""\[\d+\s+bytes,\s+4\s+rows]""".r.matches(stats))
```
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/DescribeTableSuite.scala:
##########
@@ -17,6 +17,8 @@
package org.apache.spark.sql.execution.command.v2
+import org.junit.jupiter.api.Assertions
Review Comment:
Why cannot you use `assert` from scalatest?
--
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]