druid/extensions-core
Gian Merlino 6aca61763e
SQL: Use timestamp_floor when granularity is not safe. (#13206)
* SQL: Use timestamp_floor when granularity is not safe.

PR #12944 added a check at the execution layer to avoid materializing
excessive amounts of time-granular buckets. This patch modifies the SQL
planner to avoid generating queries that would throw such errors, by
switching certain plans to use the timestamp_floor function instead of
granularities. This applies both to the Timeseries query type, and the
GroupBy timestampResultFieldGranularity feature.

The patch also goes one step further: we switch to timestamp_floor
not just in the ETERNITY + non-ALL case, but also if the estimated
number of time-granular buckets exceeds 100,000.

Finally, the patch modifies the timestampResultFieldGranularity
field to consistently be a String rather than a Granularity. This
ensures that it can be round-trip serialized and deserialized, which is
useful when trying to execute the results of "EXPLAIN PLAN FOR" with
GroupBy queries that use the timestampResultFieldGranularity feature.

* Fix test, address PR comments.

* Fix ControllerImpl.

* Fix test.

* Fix unused import.
2022-10-17 08:22:45 -07:00
..
avro-extensions Cleaner JSON for various input sources and formats. (#13064) 2022-09-12 10:29:31 -07:00
azure-extensions Lazy initialization of segment killers, movers and archivers (#13170) 2022-10-04 15:55:46 +05:30
datasketches Redesign QueryContext class (#13071) 2022-10-15 11:02:11 +05:30
druid-aws-rds-extensions Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
druid-basic-security Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
druid-bloom-filter more consistent expression error messages (#12995) 2022-09-06 23:21:38 -07:00
druid-kerberos Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
druid-pac4j Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
druid-ranger-security Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
ec2-extensions Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
google-extensions Lazy initialization of segment killers, movers and archivers (#13170) 2022-10-04 15:55:46 +05:30
hdfs-storage Lazy initialization of segment killers, movers and archivers (#13170) 2022-10-04 15:55:46 +05:30
histogram Redesign QueryContext class (#13071) 2022-10-15 11:02:11 +05:30
kafka-extraction-namespace Dependency cleanup (#13194) 2022-10-10 20:34:38 +08:00
kafka-indexing-service Adds Idle feature to `SeekableStreamSupervisor` for inactive stream (#13144) 2022-10-12 18:31:08 +05:30
kinesis-indexing-service Adds Idle feature to `SeekableStreamSupervisor` for inactive stream (#13144) 2022-10-12 18:31:08 +05:30
kubernetes-extensions Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
lookups-cached-global Improve global-cached-lookups metric reporting (#13219) 2022-10-13 18:51:54 -04:00
lookups-cached-single Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
multi-stage-query SQL: Use timestamp_floor when granularity is not safe. (#13206) 2022-10-17 08:22:45 -07:00
mysql-metadata-storage Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
orc-extensions Cleaner JSON for various input sources and formats. (#13064) 2022-09-12 10:29:31 -07:00
parquet-extensions Cleaner JSON for various input sources and formats. (#13064) 2022-09-12 10:29:31 -07:00
postgresql-metadata-storage Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
protobuf-extensions Add inline descriptor Protobuf bytes decoder (#13192) 2022-10-11 13:37:28 -05:00
s3-extensions Support to read task logs from some S3 compatible cloud storage (#13195) 2022-10-15 10:44:23 +08:00
simple-client-sslcontext Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
stats Bump up the version to 25.0.0 (#12975) 2022-08-29 11:27:38 +05:30
testing-tools more consistent expression error messages (#12995) 2022-09-06 23:21:38 -07:00