Apache Druid: a high performance real-time analytics database.
Go to file
Suneet Saldanha e03d38b6c8
Optimize join queries where filter matches nothing (#9931)
* Refactor JoinFilterAnalyzer

This patch attempts to make it easier to follow the join filter analysis code
with the hope of making it easier to add rewrite optimizations in the future.

To keep the patch small and easy to review, this is the first of at least 2
patches that are planned.

This patch adds a builder to the Pre-Analysis, so that it is easier to
instantiate the preAnalysis. It also moves some of the filter normalization
code out to Fitlers with associated tests.

* fix tests

* Refactor JoinFilterAnalyzer - part 2

This change introduces the following components:
 * RhsRewriteCandidates - a wrapper for a list of candidates and associated
     functions to operate on the set of candidates.
 * JoinableClauses - a wrapper for the list of JoinableClause that represent
     a join condition and the associated functions to operate on the clauses.
 * Equiconditions - a wrapper representing the equiconditions that are used
     in the join condition.

And associated test changes.

This refactoring surfaced 2 bugs:
 - Missing equals and hashcode implementation for RhsRewriteCandidate, thus
   allowing potential duplicates in the rhs rewrite candidates
 - Missing Filter#supportsRequiredColumnRewrite check in
   analyzeJoinFilterClause, which could result in UnsupportedOperationException
   being thrown by the filter

* fix compile error

* remove unused class

* Refactor JoinFilterAnalyzer - Correlations

Move the correlation related code out into it's own class so it's easier
to maintain.
Another patch should follow this one so that the query path uses the
correlation object instead of it's underlying maps.

* Optimize join queries where filter matches nothing

Fixes #9787

This PR changes the Joinable interface to return an Optional set of correlated
values for a column.
This allows the JoinFilterAnalyzer to differentiate between the case where the
column has no matching values and when the column could not find matching
values.

This PR chose not to distinguish between cases where correlated values could
not be computed because of a config that has this behavior disabled or because
of user error - like a column that could not be found. The reasoning was that
the latter is likely an error and the non filter pushdown path will surface the
error if it is.
2020-05-29 16:53:03 -07:00
.github De-incubation cleanup in code, docs, packaging (#9108) 2020-01-03 12:33:19 -05:00
.idea Fix type restriction for Pattern hashcode inspection (#9947) 2020-05-28 22:26:32 -07:00
benchmarks Refactor JoinFilterAnalyzer - part 2 (#9929) 2020-05-29 15:03:35 -07:00
cloud Bump up development version to 0.19.0-SNAPSHOT (#9586) 2020-03-30 16:24:04 -07:00
codestyle Forbid easily misused HashSet and HashMap constructors (#9165) 2020-02-07 10:44:09 +03:00
core Number based columns representing time in custom format cannot be used as timestamp column in Druid. (#9877) 2020-05-18 11:17:28 -07:00
dev add some details to the build doc (#9885) 2020-05-21 12:35:54 -07:00
distribution Adding support for autoscaling in GCE (#8987) 2020-04-28 03:13:39 -07:00
docs Querying doc refresh tutorial (#9879) 2020-05-29 14:32:21 -07:00
examples Add QueryResource to log4j2 template. (#9735) 2020-04-22 09:18:45 -07:00
extendedset Align library version (#9636) 2020-04-21 20:19:38 -07:00
extensions-contrib update kafka client version to 2.5.0 (#9902) 2020-05-27 13:20:32 -07:00
extensions-core update kafka client version to 2.5.0 (#9902) 2020-05-27 13:20:32 -07:00
hll Bump up development version to 0.19.0-SNAPSHOT (#9586) 2020-03-30 16:24:04 -07:00
indexing-hadoop add flag to flattenSpec to keep null columns (#9814) 2020-05-08 21:53:39 -07:00
indexing-service Fails creation of TaskResource if availabilityGroup is null (#9892) 2020-05-19 22:19:22 -07:00
integration-tests update kafka client version to 2.5.0 (#9902) 2020-05-27 13:20:32 -07:00
licenses Fix for [CVE-2020-1958]: Apache Druid LDAP injection vulnerability (#9600) 2020-04-01 14:52:01 -07:00
processing Optimize join queries where filter matches nothing (#9931) 2020-05-29 16:53:03 -07:00
publications De-incubation cleanup in code, docs, packaging (#9108) 2020-01-03 12:33:19 -05:00
server refactor SeekableStreamSupervisor usage of RecordSupplier (#9819) 2020-05-16 14:09:39 -07:00
services Add missing integration tests for the compaction by the coordinator (#9644) 2020-04-15 14:27:33 -07:00
sql Optimize join queries where filter matches nothing (#9931) 2020-05-29 16:53:03 -07:00
web-console update kafka client version to 2.5.0 (#9902) 2020-05-27 13:20:32 -07:00
website add some details to the build doc (#9885) 2020-05-21 12:35:54 -07:00
.asf.yaml Add .asf.yaml. (#9083) 2019-12-20 16:45:38 -08:00
.backportrc.json Add 0.18.0 to .backportrc.json to facilitate backport. (#9661) 2020-04-11 13:49:04 -07:00
.codecov.yml Use Codecov (#8388) 2019-08-28 08:49:30 -07:00
.dockerignore Add docker container for druid (#6896) 2019-02-08 12:12:28 +00:00
.gitignore Web console basic end-to-end-test (#9595) 2020-04-09 12:38:09 -07:00
.lgtm.yml Suppress LGTM warnings about stack trace exposure (#9631) 2020-04-09 17:31:03 -07:00
.travis.yml Disable function code coverage check (#9933) 2020-05-26 20:13:08 -07:00
CONTRIBUTING.md Fix numbered list formatting in markdown. (#9664) 2020-04-21 20:18:12 -07:00
LABELS Add plain text README.txt, use relative link from README.md to build.md (#7611) 2019-05-09 21:29:26 -07:00
LICENSE More optimize CNF conversion of filters (#9634) 2020-04-08 21:31:17 -07:00
NOTICE Fixed the Copyright year of Druid (#9859) 2020-05-20 21:13:34 -07:00
README.md Update README.md 2019-12-20 20:56:53 -08:00
README.template De-incubation cleanup in code, docs, packaging (#9108) 2020-01-03 12:33:19 -05:00
licenses.yaml update kafka client version to 2.5.0 (#9902) 2020-05-27 13:20:32 -07:00
owasp-dependency-check-suppressions.xml Suppress CVEs for openstack-keystone (#9903) 2020-05-22 10:32:17 -07:00
pom.xml update kafka client version to 2.5.0 (#9902) 2020-05-27 13:20:32 -07:00
upload.sh Adding licenses and enable apache-rat-plugin. (#6215) 2018-09-18 08:39:26 -07:00

README.md

Slack Build Status Language grade: Java Coverage Status Docker


Website | Documentation | Developer Mailing List | User Mailing List | Slack | Twitter | Download


Apache Druid

Druid is a high performance real-time analytics database. Druid's main value add is to reduce time to insight and action.

Druid is designed for workflows where fast queries and ingest really matter. Druid excels at powering UIs, running operational (ad-hoc) queries, or handling high concurrency. Consider Druid as an open source alternative to data warehouses for a variety of use cases.

Getting started

You can get started with Druid with our quickstart.

Druid provides a rich set of APIs (via HTTP and JDBC) for loading, managing, and querying your data. You can also interact with Druid via the built-in console (shown below).

Load data

data loader Kafka

Load streaming and batch data using a point-and-click wizard to guide you through ingestion setup. Monitor one off tasks and ingestion supervisors.

Manage the cluster

management

Manage your cluster with ease. Get a view of your datasources, segments, ingestion tasks, and services from one convenient location. All powered by SQL systems tables, allowing you to see the underlying query for each view.

Issue queries

query view combo

Use the built-in query workbench to prototype DruidSQL and native queries or connect one of the many tools that help you make the most out of Druid.

Documentation

You can find the documentation for the latest Druid release on the project website.

If you would like to contribute documentation, please do so under /docs in this repository and submit a pull request.

Community

Community support is available on the druid-user mailing list, which is hosted at Google Groups.

Development discussions occur on dev@druid.apache.org, which you can subscribe to by emailing dev-subscribe@druid.apache.org.

Chat with Druid committers and users in real-time on the #druid channel in the Apache Slack team. Please use this invitation link to join the ASF Slack, and once joined, go into the #druid channel.

Building from source

Please note that JDK 8 is required to build Druid.

For instructions on building Druid from source, see docs/development/build.md

Contributing

Please follow the community guidelines for contributing.

For instructions on setting up IntelliJ dev/intellij-setup.md

License

Apache License, Version 2.0