Skip to content

Consolidate a bunch of ad-hoc segments metadata SQL; fix some bugs.#11582

Merged
clintropolis merged 6 commits intoapache:masterfrom
gianm:fix-sql-whacky-dates
Nov 24, 2021
Merged

Consolidate a bunch of ad-hoc segments metadata SQL; fix some bugs.#11582
clintropolis merged 6 commits intoapache:masterfrom
gianm:fix-sql-whacky-dates

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Aug 12, 2021

This patch gathers together a variety of SQL from SqlSegmentsMetadataManager
and IndexerSQLMetadataStorageCoordinator into a new class SqlSegmentsMetadataQuery.
It focuses on SQL related to retrieving segment payloads and marking
segments used and unused.

In addition to cleaning up the code a bit, this patch also fixes a bug
with years before 0 or after 9999. The prior SQL did not work properly
because dates outside this range cannot be compared as strings. The new
code does work for these far-past and far-future years.

So, if you're ever interested in using Druid to analyze things from
ancient Babylon, you better apply this patch first!

This patch gathers together a variety of SQL from SqlSegmentsMetadataManager
and IndexerSQLMetadataStorageCoordinator into a new class SqlSegmentsMetadataQuery.
It focuses on SQL related to retrieving segment payloads and marking
segments used and unused.

In addition to cleaning up the code a bit, this patch also fixes a bug
with years before 0 or after 9999. The prior SQL did not work properly
because dates outside this range cannot be compared as strings. The new
code does work for these far-past and far-future years.

So, if you're ever interested in using Druid to analyze things from
ancient Babylon, you better apply this patch first!
@clintropolis clintropolis merged commit 3d72e66 into apache:master Nov 24, 2021
@gianm gianm deleted the fix-sql-whacky-dates branch November 25, 2021 00:15
@abhishekagarwal87 abhishekagarwal87 added this to the 0.23.0 milestone May 11, 2022
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.

3 participants