pan3793 commented on code in PR #2773:
URL: https://github.com/apache/incubator-kyuubi/pull/2773#discussion_r884241958
##########
extensions/spark/kyuubi-spark-connector-tpcds/src/main/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSStatisticsUtils.scala:
##########
@@ -24,13 +24,18 @@ import io.trino.tpcds.Table._
// Page 42 Table 3-2 Database Row Counts
object TPCDSStatisticsUtils {
+ val TINY_SCHEMA_NAME = "tiny"
+
+ val TINY_SCALE_FACTOR = 0.01
+
val SCALES: Array[Int] = Array(0, 1, 10, 100, 300, 1000, 3000, 10000, 30000,
100000)
// https://github.com/Teradata/tpcds/issues/26
- def numRows(table: Table, scale: Int): Long = {
- require(SCALES.contains(scale), s"Unsupported scale $scale")
+ def numRows(table: Table, scale: Double): Long = {
+ require(SCALES.contains(scale) || scale == TINY_SCALE_FACTOR,
s"Unsupported scale $scale")
Review Comment:
it's not a good practice to use `==` to compare two double values, we
should always use `abs(d1 - d2) < epsilon` for that.
--
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]