Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-5011

Detect and scatter skewed data in dict encoding step

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • v4.0.0-beta
    • v4.0.0
    • Job Engine
    • None

    Description

      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:

      1. sample from source data and detect skewed data
      2. build skewed data's dictionary
      3. customize an repartition function to scatter skewed data to random partitions
      4. 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

      Attachments

        1. image-2021-06-15-10-54-19-419.png
          85 kB
          Shengjun Zheng

        Activity

          People

            zhengshengjun Shengjun Zheng
            zhengshengjun Shengjun Zheng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: