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

Support changing dimension schema in Auto Compaction #11874

Merged
merged 17 commits into from
Nov 9, 2021

Conversation

maytasm
Copy link
Contributor

@maytasm maytasm commented Nov 3, 2021

Support changing dimension schema in Auto Compaction

Description

Changing dimensionsSpec is already supported in manual compaction task. This PR adds it to the auto compaction.
By changing dimensionsSpec, the user will be able to change the dimension ordering, remove dimension, and change dimension data type.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@@ -988,7 +989,7 @@ The below is a list of the supported configurations for auto compaction.
|`chatHandlerNumRetries`|Retries for reporting the pushed segments in worker tasks.|no (default = 5)|

###### Automatic compaction granularitySpec
You can optionally use the `granularitySpec` object to configure the segment granularity of the compacted segments.
You can optionally use the `granularitySpec` object to configure the granularity and rollup of the compacted segments.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These fields are defined below, so it seems redundant to mention them again here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

existingDimensionsSpec.getDimensions() :
null;
if (!config.getDimensionsSpec().getDimensions().equals(existingDimensions)) {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Please add a log line here for operators to know why the segment was selected for compaction similar to segmentGranularity above.

Similar comments for rollup + queryGranularity

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (config.getDimensionsSpec() != null) {
final DimensionsSpec existingDimensionsSpec = lastCompactionState.getDimensionsSpec();
// Checks for list of dimensions
if (config.getDimensionsSpec().getDimensions() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If config.getDimensionsSpec().getDimensions() == null and lastCompactionState.getDimensionsSpec() is non-null then we want needsCompaction to return false. Is that understanding correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. If config.getDimensionsSpec().getDimensions() == null then needsCompaction will return false regardless of lastCompactionState.getDimensionsSpec() value

Copy link
Contributor

@suneet-s suneet-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 after CI

@maytasm maytasm merged commit ddc68c6 into apache:master Nov 9, 2021
@maytasm maytasm deleted the IMPLY-11781 branch November 9, 2021 05:17
@abhishekagarwal87 abhishekagarwal87 added this to the 0.23.0 milestone May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants