[GitHub] carbondata pull request #1253: [CARBONDATA-1373] Enhance update performance ...

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1253: [CARBONDATA-1373] Enhance update performance ...

qiuchenjian-2
GitHub user xuchuanyin opened a pull request:

    https://github.com/apache/carbondata/pull/1253

    [CARBONDATA-1373] Enhance update performance by increasing parallelism

    # Scenario
   
    Recently I have tested the update feature provided in Carbondata and found its poor performance.
   
    I had a table containing about 14 million records with about 370 columns(no dictionary columns) and the data files are about 3.8 GB in total. All the data files were in one segment.
   
    I performed an update SQL which update a column for all the records and the SQL looked like `UPDATE myTable SET (col1)=(col1+1000) WHERE TRUE`. In my environment, the update job failed with 'executor lost errors'. And I found 'spill data' related messages in the container logs.
   
    # Analyze
   
    I've read about the implementation of update-delete in Carbondata in ISSUE#440. The update consists a delete and an insert operation. And the error occurred during the insert operation.
   
    After studying the code, I have found that while doing inserting, the updated records are grouped by the `segmentId`, which means all the recoreds in one segment will be processed in only one task, thus will cause task failure when the amount of input data is quite large.
   
    # Solution
   
    We should improve the parallelism when doing update for a segment.
   
    I append a random key to the `segmentId` to increase the partition number before doing the insertion stage and then remove the suffix when doing the real insertion.
   
    # Modification
   
    + Increase parallelism while processing one segment in update
    + Add a property to configure the parallelism
    + Clean up local files after update (previous bugs)
   
    # Notes
   
    I have tested in my example and the job finished in about 13 minutes successfully. The records were updated as expected.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xuchuanyin/carbondata enhance_update

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/1253.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1253
   
----
commit 84a4fe5e9afcd127cf976cda55bc6bfd8faf4e32
Author: xuchuanyin <[hidden email]>
Date:   2017-08-11T15:00:20Z

    Enhance update performance by increasing parallelism
   
    + Increase parallelism while processing one segment in update
    + Add a property to configure the parallelism
    + Clean up local files after update (previous bugs)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1253: [CARBONDATA-1373] Enhance update performance by incr...

qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1253
 
    SDV Build Success with Spark 2.1, Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/191/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1253: [CARBONDATA-1373] Enhance update performance by incr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user sraghunandan commented on the issue:

    https://github.com/apache/carbondata/pull/1253
 
    In update case, group by is not required.We can use partition by and this should solve the problem


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1253: [CARBONDATA-1373] Enhance update performance by incr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on the issue:

    https://github.com/apache/carbondata/pull/1253
 
    @sraghunandan Do you mean partitionBy a customized partitioner or  just partitionedBy segmentId?
   
    partitionBy segmentId will forward all records of a segment to a single partition, which will still cause the problem if a screwed partition has too many data.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1253: [CARBONDATA-1373] Enhance update performance by incr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on the issue:

    https://github.com/apache/carbondata/pull/1253
 
    @sraghunandan I've implemented by using partitionBy as you suggested in https://github.com/xuchuanyin/carbondata/pull/10/files, Is this OK?
   
    I customize a partitioner and make the records of a segment available in different partition to avoid a
     partition with single huge segment.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1253: [CARBONDATA-1373] Enhance update performance by incr...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on the issue:

    https://github.com/apache/carbondata/pull/1253
 
    A new PR #1261 has been raised to solve this problem in a better way.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1253: [CARBONDATA-1373] Enhance update performance ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin closed the pull request at:

    https://github.com/apache/carbondata/pull/1253


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---