gianm commented on code in PR #14151:
URL: https://github.com/apache/druid/pull/14151#discussion_r1176958112
##########
processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java:
##########
@@ -155,26 +158,31 @@ public Iterator<Result<TimeBoundaryResultValue>> make()
"Null storage adapter found. Probably trying to issue a
query against a segment being memory unmapped."
);
}
- final DateTime minTime;
- final DateTime maxTime;
-
- if (legacyQuery.getFilter() != null ||
!queryIntervalContainsAdapterInterval()) {
- minTime = getTimeBoundary(adapter, legacyQuery, false);
- if (minTime == null) {
- maxTime = null;
- } else {
- maxTime = getTimeBoundary(adapter, legacyQuery, true);
+
+ DateTime minTime = null;
+ DateTime maxTime = null;
+
+ if (canUseAdapterMinMaxTime(query, adapter)) {
+ if (!query.isMaxTime()) {
+ minTime = adapter.getMinTime();
Review Comment:
Javadoc sounds like a good idea to me. It's `@PublicApi` so we should keep
the method name as-is.
I added this to `StorageAdapter#getMinTime`, and similar text to
`getMaxTime` as well:
```
/**
* Metadata-only operation that returns a lower bound on
* {@link org.apache.druid.segment.column.ColumnHolder#TIME_COLUMN_NAME}
values for this adapter. May be earlier than
* the actual minimum data timestamp.
*
* For {@link QueryableIndexStorageAdapter} and {@link
org.apache.druid.segment.incremental.IncrementalIndexStorageAdapter}
* specifically, which back regular tables (i.e. {@link
org.apache.druid.query.TableDataSource}), this method
* contract is tighter: it does return the actual minimum data timestamp.
This fact is leveraged by
* {@link org.apache.druid.query.timeboundary.TimeBoundaryQuery} to return
results using metadata only.
*/
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]