[
https://issues.apache.org/jira/browse/KYLIN-5011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17366394#comment-17366394
]
ASF GitHub Bot commented on KYLIN-5011:
---------------------------------------
hit-lacus commented on a change in pull request #1662:
URL: https://github.com/apache/kylin/pull/1662#discussion_r655095908
##########
File path:
core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
##########
@@ -3125,4 +3125,32 @@ public int getRepartitionNumAfterEncode() {
public boolean rePartitionEncodedDatasetWithRowKey() {
return
Boolean.valueOf(getOptional("kylin.engine.spark.repartition.encoded.dataset",
"false"));
}
+
+ /*
+ * Detect dataset skew in dictionary encode step.
+ * */
+ public boolean detectDataSkewInDictEncodingEnabled() {
+ return
Boolean.valueOf(getOptional("detect.data.skew.in.dict.encoding", "false"));
+ }
+
+ /*
+ * In some data skew cases, the repartition step during dictionary encoding
will be slow.
+ * We can choose to sample from the dataset to detect skewed. This
configuration is used to set the sample rate.
+ * */
+ public double sampleRateInEncodingSkewDetection() {
+ return
Double.valueOf(getOptional("sample.rate.in.encoding.skew.detection", "0.1"));
+ }
+
+ /*
+ * In KYLIN4, dictionaries are hashed into several buckets, column data are
repartitioned by the same hash algorithm
+ * during encoding step too. In data skew cases, the repartition step will
be very slow. Kylin will automatically
+ * sample from the source to detect skewed data and repartition these
skewed data to random partitions.
+ * This configuration is used to set the skew data threshhold, valued from
0 to 1.
+ * e.g.
+ * if you set this value to 0.05, for each value that takes up more than
5% percent of the total will be regarded
+ * as skew data, as a result the skewed data will be no more than 20
records
+ * */
+ public double skewOccupationThreshHold() {
+ return Double.valueOf(getOptional("skew.occupation.threshhold",
"0.05"));
Review comment:
`kylin.dictionary.data.skew.key.percentage.threshhold`
##########
File path:
core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
##########
@@ -3125,4 +3125,32 @@ public int getRepartitionNumAfterEncode() {
public boolean rePartitionEncodedDatasetWithRowKey() {
return
Boolean.valueOf(getOptional("kylin.engine.spark.repartition.encoded.dataset",
"false"));
}
+
+ /*
+ * Detect dataset skew in dictionary encode step.
+ * */
+ public boolean detectDataSkewInDictEncodingEnabled() {
+ return
Boolean.valueOf(getOptional("detect.data.skew.in.dict.encoding", "false"));
+ }
+
+ /*
+ * In some data skew cases, the repartition step during dictionary encoding
will be slow.
+ * We can choose to sample from the dataset to detect skewed. This
configuration is used to set the sample rate.
+ * */
+ public double sampleRateInEncodingSkewDetection() {
Review comment:
`kylin.dictionary.data.skew.detect.sample.rate`
--
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]
> Detect and scatter skewed data in dict encoding step
> ----------------------------------------------------
>
> Key: KYLIN-5011
> URL: https://issues.apache.org/jira/browse/KYLIN-5011
> Project: Kylin
> Issue Type: New Feature
> Components: Job Engine
> Affects Versions: v4.0.0-beta
> Reporter: ShengJun Zheng
> Assignee: ShengJun Zheng
> Priority: Major
> Fix For: v4.0.0
>
> Attachments: image-2021-06-15-10-54-19-419.png
>
>
> In KYLIN4, dictionaries are hashed into several buckets, column data are
> repartitioned to the same partition size as bucket size. Then, each encoding
> task is able to load a piece of dictionary bucket to accelerate the encoding
> step.
> Recently we are troubled by this improvement when data skew happens. In some
> of our cases, the repartition step during encoding is even impossible to
> finish . Whereas this works fine in KYLIN3, for each Spark task will load all
> dictionary of a column and encode column values to int values. There is no
> need to do repartition step in KYLIN3.
> We solve this by:
> # sample from source data and detect skewed data
> # build skewed data's dictionary
> # customize an repartition function to scatter skewed data to random
> partitions
> # do encoding with both skewed dictionary and dictionary loaded within each
> partition
> After this improvement, some of our cube's build time reduced from 190min to
> 30min
> !image-2021-06-15-10-54-19-419.png!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)