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

Add more statement attributes to explain plan result. #14391

Merged
merged 19 commits into from
Jun 12, 2023

Conversation

abhishekrb19
Copy link
Contributor

@abhishekrb19 abhishekrb19 commented Jun 8, 2023

This PR adds the following to the ATTRIBUTES column in the explain plan output:

  • partitionedBy
  • clusteredBy
  • replaceTimeChunks

This PR leverages the work done in #14074, which added a new column ATTRIBUTES to encapsulate all the statement-related attributes.

Release note

EXPLAIN PLAN result includes a new column ATTRIBUTES that describes the attributes of a query. See docs/querying/sql-translation.md for more information and examples.


Key changed/added classes in this PR
  • ExplainAttributes.java
  • ExplainAttributesTest.java

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • 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.

@abhishekrb19 abhishekrb19 changed the title Add more statement-attributes explicitly to explain plan attributes column. Add more statement attributes explicitly to explain plan attributes column. Jun 9, 2023
@abhishekrb19 abhishekrb19 changed the title Add more statement attributes explicitly to explain plan attributes column. Add more statement attributes to explain plan result. Jun 9, 2023
Copy link
Contributor

@amaechler amaechler left a comment

Choose a reason for hiding this comment

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

Nice 🐻

@abhishekrb19
Copy link
Contributor Author

abhishekrb19 commented Jun 11, 2023

Thanks for the reviews! Since we're officially documenting attributes for the next release, I also added a new unit test to test the serialization part, so we don't accidentally change how things are serialized moving forward.

@@ -107,6 +112,7 @@ public String getClusteredBy()
*/
@Nullable
@JsonProperty
@JsonInclude(JsonInclude.Include.NON_NULL)
Copy link
Contributor

@kfaraz kfaraz Jun 12, 2023

Choose a reason for hiding this comment

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

Would it work to have this annotation just once at the class level instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it seems like we do a mix of method-level and class-level annotations in the codebase. Since we already do @Nullable consistently for all the methods in this class, I just stuck with the former.

Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@kfaraz kfaraz merged commit 326f2c5 into apache:master Jun 12, 2023
@abhishekagarwal87 abhishekagarwal87 added this to the 27.0 milestone Jul 19, 2023
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.

4 participants