zzcclp commented on a change in pull request #1618:
URL: https://github.com/apache/kylin/pull/1618#discussion_r610437446



##########
File path: 
kylin-spark-project/kylin-spark-engine/src/main/scala/org/apache/kylin/engine/spark/builder/CubeTableEncoder.scala
##########
@@ -63,7 +67,20 @@ object CubeTableEncoder extends Logging {
           .select(columns: _*)
       }
     )
+
     ds.sparkSession.sparkContext.setJobDescription(null)
+
+    //repartition by a single column during dict encode step before is more 
easily to cause data skew, add step to void such case.
+    if (!cols.isEmpty && seg.kylinconf.rePartitionEncodedDatasetWithRowKey) {
+      val colsInDS = partitionedDs.schema.map(_.name)
+      val rowKeyColRefs = seg.allRowKeyCols.map(colDesc => 
convertFromDot(colDesc.identity)).filter(colsInDS.contains).map(col)
+      //if not set in config, use the largest partition num during dict encode 
step
+      if (seg.kylinconf.getRepartitionNumAfterEncode < 1) {

Review comment:
       This is wrong, needs to modify to 
`seg.kylinconf.getRepartitionNumAfterEncode > 0`, otherwise when set this 
parameter to 5, for example, it doesn't use the value of this parameter to set 
to `repartitionSizeAfterEncode`.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to