[CARBONDATA-4316]Fix horizontal compaction failure for partition tables
authorakashrn5 <akashnilugal@gmail.com>
Tue, 7 Dec 2021 13:25:13 +0000 (18:55 +0530)
committerkunal642 <kunalkapoor642@gmail.com>
Wed, 22 Dec 2021 13:20:00 +0000 (18:50 +0530)
commitd629dc0b894a64bfbef762736775a182e40827fe
tree1982c26233a163f09247ca1cbc9794c128f11ace
parentf266a73e531fda02f0ab2bffffe0a788ee08cea9
[CARBONDATA-4316]Fix horizontal compaction failure for partition tables

Why is this PR needed?
Horizontal compaction fails for partition table leading to many delete
delta files for a single block, leading to slower query performance.
This is happening because during horizontal compaction the delta file
path prepared for the partition table is wrong which fails to identify
the path and fails the operation.

What changes were proposed in this PR?
If it is a partition table, read the segment file and identity the
partition where the block is present to prepare a proper partition path.

This closes #4240
core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForDeleteCommand.scala
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/mutation/HorizontalCompaction.scala
integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/iud/DeleteCarbonTableTestCase.scala
processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java