Akshat-Jain commented on code in PR #16307:
URL: https://github.com/apache/druid/pull/16307#discussion_r1570512941
##########
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:
@cryptoe The cache scheduler layer doesn't seem to have lookup name
information. It only has the JdbcExtractionNamespace level information - which
is what gets logged everywhere else in the cache scheduler layer as well.
Technically we can add an extra method param to send lookup name info all
the way down to the cache layer through the whole method chain, but that seems
unnecessary to me. That would also then require us to change logging everywhere
else in the cache layer, just to ensure consistency - so it would end up as a
much wider change.
Thoughts?
--
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]