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

Setting useNativeQueryExplain to true #12936

Merged
merged 5 commits into from
Aug 24, 2022

Conversation

cryptoe
Copy link
Contributor

@cryptoe cryptoe commented Aug 22, 2022

As per discussion in slack thread: https://apachedruidworkspace.slack.com/archives/C0309C9L90D/p1660833886743589?thread_ts=1660833233.334529&cid=C0309C9L90D

Setting useNativeQueryExplain to true by default.

Now queries like :

EXPLAIN PLAN FOR
SELECT TIME_FLOOR(__time, 'PT1M') AS "timestamp"
FROM "my-datasource"
WHERE __time >= CURRENT_TIMESTAMP - INTERVAL '1' DAY

would show the native query by DEFAULT

from

DruidQueryRel(query=[{"queryType":"scan","dataSource":{"type":"table","name":"abc_testing"},"intervals":{"type":"intervals","intervals":["2022-08-21T13:56:26.363Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[{"type":"expression","name":"v0","expression":"timestamp_floor(\"__time\",'PT1M',null,'UTC')","outputType":"LONG"}],"resultFormat":"compactedList","limit":101,"columns":["v0"],"legacy":false,"context":{"sqlOuterLimit":101,"sqlQueryId":"7f63aa96-4cff-42d9-96cb-8320b0e51e06","useNativeQueryExplain":"false"},"granularity":{"type":"all"}}], signature=[{v0:LONG}])

to

[{"query":{"queryType":"scan","dataSource":{"type":"table","name":"abc_testing"},"intervals":{"type":"intervals","intervals":["2022-08-21T13:51:33.422Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[{"type":"expression","name":"v0","expression":"timestamp_floor(\"__time\",'PT1M',null,'UTC')","outputType":"LONG"}],"resultFormat":"compactedList","limit":101,"columns":["v0"],"legacy":false,"context":{"sqlOuterLimit":101,"sqlQueryId":"7d028f96-7080-46a4-9581-2557df73d882"},"granularity":{"type":"all"}},"signature":[{"name":"v0","type":"LONG"}]}]

As this is a behavior change, we should tag this PR with release notes.


Key changed/added classes in this PR
  • PlannerConfig

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.

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.

None yet

4 participants