kfaraz commented on code in PR #16307:
URL: https://github.com/apache/druid/pull/16307#discussion_r1570766211


##########
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:
   You can do this:
   ```suggestion
         LOG.info("Lookup table[%s] is empty. No rows returned for the 
query[%s].", table, query);
   ```



-- 
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]

Reply via email to