Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CARBONDATA-4149] Fix query issues after alter add partition. #4107

Closed
wants to merge 1 commit into from

Conversation

ShreelekhyaG
Copy link
Contributor

@ShreelekhyaG ShreelekhyaG commented Mar 15, 2021

Why is this PR needed?

Query with SI after add partition based on location on partition table gives incorrect results.

  1. While pruning, if it's an external segment, it should use ExternalSegmentResolver , and no need to use ImplicitIncludeFilterExecutor as an external segment is not added in the SI table.
  2. If the partition table has external partitions, after compaction the new files are loaded to the external path.
  3. Data is not loaded to the child table(MV) after executing add partition command

What changes were proposed in this PR?

  1. add path to loadMetadataDetails for external partition. It is used to identify it as an external segment.
  2. After compaction, to not maintain any link to the external partition, the compacted files will be added as a new partition in the table. To update partition spec details in hive metastore, (drop partition + add partition) operations performed.
  3. Add Load Pre and Post listener's in CarbonAlterTableAddHivePartitionCommand to trigger data load to materialized view.

Does this PR introduce any user interface change?

  • No

Is any new testcase added?

  • Yes

@CarbonDataQA2
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5568/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3802/

@ShreelekhyaG ShreelekhyaG changed the title [CARBONDATA-4149] Query with SI after add partition based on location on partition table gives incorrect results [WIP] Query with SI after add partition based on location on partition table gives incorrect results Mar 16, 2021
@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3811/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5577/

@ShreelekhyaG ShreelekhyaG changed the title [WIP] Query with SI after add partition based on location on partition table gives incorrect results [CARBONDATA-4149] Query with SI after add partition based on location on partition table gives incorrect results Mar 18, 2021
@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3815/

@CarbonDataQA2
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5581/

@CarbonDataQA2
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5593/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3827/

@CarbonDataQA2
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5594/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3828/

@Indhumathi27
Copy link
Contributor

@ShreelekhyaG please update PR description

@ShreelekhyaG ShreelekhyaG changed the title [CARBONDATA-4149] Query with SI after add partition based on location on partition table gives incorrect results [CARBONDATA-4149] Fix query issues after alter add partition. Mar 19, 2021
update partitionspec path after compaction

load data to mv after add partition

rework

fix for muliple partitions

removed old,new
@Indhumathi27
Copy link
Contributor

LGTM

@CarbonDataQA2
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5602/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3836/

@asfgit asfgit closed this in b00efca Mar 19, 2021
Indhumathi27 pushed a commit to Indhumathi27/carbondata that referenced this pull request Apr 22, 2021
Why is this PR needed?
Query with SI after add partition based on location on partition table gives incorrect results.
1. While pruning, if it's an external segment, it should use ExternalSegmentResolver , and no
   need to use ImplicitIncludeFilterExecutor as an external segment is not added in the SI table.
2. If the partition table has external partitions, after compaction the new files are loaded
   to the external path.
3. Data is not loaded to the child table(MV) after executing add partition command

What changes were proposed in this PR?
1. add path to loadMetadataDetails for external partition. It is used to identify it as an
   external segment.
2. After compaction, to not maintain any link to the external partition, the compacted files
   will be added as a new partition in the table. To update partition spec details in hive metastore,
   (drop partition + add partition) operations performed.
3. Add Load Pre and Post listener's in CarbonAlterTableAddHivePartitionCommand to trigger data
   load to materialized view.

Does this PR introduce any user interface change?
No

Is any new testcase added?
Yes

This closes apache#4107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants