LakshSingla commented on code in PR #16307:
URL: https://github.com/apache/druid/pull/16307#discussion_r1570948900
##########
extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/JdbcCacheGenerator.java:
##########
@@ -204,18 +204,20 @@ private Long
lastUpdates(CacheScheduler.EntryImpl<JdbcExtractionNamespace> key,
if (tsColumn == null) {
return null;
}
+ final String query = StringUtils.format(
+ "SELECT MAX(%s) FROM %s",
+ tsColumn, table
+ );
final Timestamp update = dbi.withHandle(
- handle -> {
- final String query = StringUtils.format(
- "SELECT MAX(%s) FROM %s",
- tsColumn, table
- );
- return handle
- .createQuery(query)
- .map(TimestampMapper.FIRST)
- .first();
- }
+ handle -> handle
+ .createQuery(query)
+ .map(TimestampMapper.FIRST)
+ .first()
);
+ if (update == null) {
+ LOG.info("Lookup table is empty. No rows returned for the query: %s",
query);
Review Comment:
Wouldn't INFO logging be too noisy, given that this will log every time we
run a check (to see whether to update the table or not)? (By default, it is set
to not poll, so the default behaviour is cool)
--
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]