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 context flag "useAutoColumnSchemas" to use new auto types for MSQ segment generation #14175

Merged

Conversation

clintropolis
Copy link
Member

Description

Adds new MSQ query context parameter useAutoColumnSchemas as a sort of hacky backdoor to allow using the latest and greatest features added in #14014 and related PRs (#13803, etc). When set, all columns except for custom COMPLEX column types will use the native 'auto' column indexer added in #14014 when generating segments. I call this a bit hacky because MSQ doesn't officially support the true array types besides ARRAY<STRING>, which is translated into STRING unless the new context flag is set, but other array types can be still be ingested by specifying COMPLEX<json> as the input schema to use the complex passthrough.

I did not document this at this time on purpose, this is mainly for allowing experimentation with the newer column features and MSQ.

This PR has:

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

Copy link
Contributor

@cryptoe cryptoe left a comment

Choose a reason for hiding this comment

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

Changes lgtm!!

@@ -213,6 +215,11 @@ public static IndexSpec getIndexSpec(final QueryContext queryContext, final Obje
return decodeIndexSpec(queryContext.get(CTX_INDEX_SPEC), objectMapper);
}

public static boolean useAutoColumnSchemas(final QueryContext queryContext)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please document the use of this externally undocumented feature in the class level docs. https://github.com/apache/druid/pull/14175/files#diff-cbcc2f2c9d571876786fe63eef35c2d82d64de0700334267c22f83f31d633af0L51

@cryptoe cryptoe added the Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 label Apr 27, 2023
@clintropolis clintropolis changed the title add context flag "useAutoColumnSchemas" to use new auto types for segment generation add context flag "useAutoColumnSchemas" to use new auto types for MSQ segment generation May 10, 2023
@clintropolis clintropolis merged commit 625c474 into apache:master May 10, 2023
@clintropolis clintropolis deleted the query-context-msq-auto-columns branch May 10, 2023 22:37
@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
Labels
Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants