nickSoul commented on a change in pull request #1662:
URL: https://github.com/apache/kylin/pull/1662#discussion_r655776336
##########
File path:
kylin-spark-project/kylin-spark-engine/src/main/scala/org/apache/kylin/engine/spark/builder/CubeTableEncoder.scala
##########
@@ -61,15 +66,59 @@ object CubeTableEncoder extends Logging {
val encodeColRef = convertFromDot(ref.identity)
val columnIndex = structType.fieldIndex(encodeColRef)
- val dictParams = Array(seg.project, ref.tableAliasName,
ref.columnName, seg.kylinconf.getHdfsWorkingDirectory)
+ var dictParams = Array(seg.project, ref.tableAliasName,
ref.columnName, seg.kylinconf.getHdfsWorkingDirectory)
.mkString(SEPARATOR)
val aliasName =
structType.apply(columnIndex).name.concat(ENCODE_SUFFIX)
- val encodeCol = dict_encode(col(encodeColRef).cast(StringType),
lit(dictParams), lit(bucketSize).cast(StringType)).as(aliasName)
- val columns = partitionedDs.schema.map(ty => col(ty.name)) ++
Seq(encodeCol)
+ var encodeCol = dict_encode(col(encodeColRef).cast(StringType),
lit(dictParams), lit(bucketSize).cast(StringType)).as(aliasName)
+ val columns = partitionedDs.schema.map(ty => col(ty.name))
+
+ if (seg.kylinconf.detectDataSkewInDictEncodingEnabled()) {
+ //find skewed data in dict-encoding step
+ val sampleData =
ds.sample(seg.kylinconf.sampleRateInEncodingSkewDetection()).cache()
Review comment:
good suggestion
--
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]