Skip to content

refactor CompactionState since core and processing have been merged#14932

Closed
clintropolis wants to merge 5 commits intoapache:masterfrom
clintropolis:cooler-compaction-state
Closed

refactor CompactionState since core and processing have been merged#14932
clintropolis wants to merge 5 commits intoapache:masterfrom
clintropolis:cooler-compaction-state

Conversation

@clintropolis
Copy link
Copy Markdown
Member

@clintropolis clintropolis commented Aug 31, 2023

Since #13698 was merged, it is now possible for CompactionState to refer to real types instead of using Map and TypeReference to convert stuff for TransformSpec, IndexSpec, and AggregatorFactory.

@clintropolis
Copy link
Copy Markdown
Member Author

GranularitySpec is still in druid-server and so is still defined using a Map. Should we move it into druid-processing? It doesn't seem to depend on anything else in server to require it be there...

@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Aug 31, 2023

Yeah, it makes sense to move GranularitySpec to druid-processing to help simplify CompactionState further.

: new DimensionsSpec(ingestionSpec.getDataSchema().getDimensionsSpec().getDimensions());
// We only need to store filter since that is the only field auto compaction support
Map<String, Object> transformSpec = ingestionSpec.getDataSchema().getTransformSpec() == null || TransformSpec.NONE.equals(ingestionSpec.getDataSchema().getTransformSpec())
TransformSpec transformSpec = ingestionSpec.getDataSchema().getTransformSpec() == null || TransformSpec.NONE.equals(ingestionSpec.getDataSchema().getTransformSpec())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Pull ingestionSpec.getDataSchema().getTransformSpec() into a variable. It is used thrice and seems too verbose.

? null
: toolbox.getJsonMapper().convertValue(ingestionSpec.getDataSchema().getAggregators(), new TypeReference<List<Object>>() {});
TransformSpec transformSpec = ingestionSpec.getDataSchema().getTransformSpec();
if (TransformSpec.NONE.equals(transformSpec)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this handle transformSpec == null too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ah yeah, though i put a not null check in the else instead since it seemed a little strange to check for null and assign null again

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
import org.apache.druid.indexer.granularity.GranularitySpec;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: This might get flagged as an unnecessary import as it is only used in javadoc.

// org.apache.druid.query.aggregation.AggregatorFactory cannot be used here because it's in the 'processing' module which
// has a dependency on the 'core' module where this class is.
private final List<Object> metricsSpec;
// 'server' module which has a dependency on the 'processing' module where this class is.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can remove this comment too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oops, fixed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 2, 2024

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the dev@druid.apache.org list.
Thank you for your contributions.

@github-actions github-actions Bot added the stale label Mar 2, 2024
@kfaraz kfaraz removed the stale label Mar 4, 2024
@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Mar 4, 2024

@clintropolis , there are some conflicts that would need to be resolved before we can merge this.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2024

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the dev@druid.apache.org list.
Thank you for your contributions.

@github-actions github-actions Bot added the stale label May 4, 2024
@kfaraz kfaraz removed the stale label May 7, 2024
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 7, 2024

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the dev@druid.apache.org list.
Thank you for your contributions.

@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Sep 2, 2024

@clintropolis , should we resolve the conflicts here so that we can include this patch in Druid 31?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 2, 2024

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the dev@druid.apache.org list.
Thank you for your contributions.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 5, 2025

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the dev@druid.apache.org list.
Thank you for your contributions.

@github-actions github-actions Bot added the stale label Jan 5, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 3, 2025

This pull request/issue has been closed due to lack of activity. If you think that
is incorrect, or the pull request requires review, you can revive the PR at any time.

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.

2 participants