You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/06/15 01:30:51 UTC

[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #2882: [KYUUBI #2543] Add `maxPartitionBytes` configuration for TPC-DS connecter

pan3793 commented on code in PR #2882:
URL: https://github.com/apache/incubator-kyuubi/pull/2882#discussion_r897445017


##########
extensions/spark/kyuubi-spark-connector-tpcds/src/main/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSBatchScan.scala:
##########
@@ -36,19 +36,18 @@ case class TPCDSTableChuck(table: String, scale: Double, parallelism: Int, index
 class TPCDSBatchScan(
     @transient table: Table,
     scale: Double,
-    schema: StructType) extends ScanBuilder
+    schema: StructType,
+    scanConf: TPCDSBatchScanConf) extends ScanBuilder
   with SupportsReportStatistics with Batch with Serializable {
 
   private val _sizeInBytes: Long = TPCDSStatisticsUtils.sizeInBytes(table, scale)
   private val _numRows: Long = TPCDSStatisticsUtils.numRows(table, scale)
 
-  private val rowCountPerTask: Int = 1000000
-
   private val parallelism: Int =
     if (table.isSmall) 1
     else math.max(
       SparkSession.active.sparkContext.defaultParallelism,
-      (_numRows / rowCountPerTask.toDouble).ceil.toInt)
+      (_sizeInBytes / scanConf.taskPartitionBytes).ceil.toInt)

Review Comment:
   There is still a hardcode 1 million in the TPCDS library, let's comment on it somewhere.



##########
extensions/spark/kyuubi-spark-connector-tpcds/src/main/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSBatchScan.scala:
##########
@@ -36,19 +36,18 @@ case class TPCDSTableChuck(table: String, scale: Double, parallelism: Int, index
 class TPCDSBatchScan(
     @transient table: Table,
     scale: Double,
-    schema: StructType) extends ScanBuilder
+    schema: StructType,
+    scanConf: TPCDSBatchScanConf) extends ScanBuilder
   with SupportsReportStatistics with Batch with Serializable {
 
   private val _sizeInBytes: Long = TPCDSStatisticsUtils.sizeInBytes(table, scale)
   private val _numRows: Long = TPCDSStatisticsUtils.numRows(table, scale)
 
-  private val rowCountPerTask: Int = 1000000
-
   private val parallelism: Int =
     if (table.isSmall) 1
     else math.max(
       SparkSession.active.sparkContext.defaultParallelism,
-      (_numRows / rowCountPerTask.toDouble).ceil.toInt)
+      (_sizeInBytes / scanConf.taskPartitionBytes).ceil.toInt)

Review Comment:
   There is still a hardcode 1 million in the TPCDS library, let's comment on it somewhere.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org