Skip to content

add context flag "useAutoColumnSchemas" to use new auto types for MSQ segment generation#14175

Merged
clintropolis merged 3 commits intoapache:masterfrom
clintropolis:query-context-msq-auto-columns
May 10, 2023
Merged

add context flag "useAutoColumnSchemas" to use new auto types for MSQ segment generation#14175
clintropolis merged 3 commits intoapache:masterfrom
clintropolis:query-context-msq-auto-columns

Conversation

@clintropolis
Copy link
Copy Markdown
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
Copy Markdown
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!!

return decodeIndexSpec(queryContext.get(CTX_INDEX_SPEC), objectMapper);
}

public static boolean useAutoColumnSchemas(final QueryContext queryContext)
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.

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