Akshat-Jain commented on code in PR #16307:
URL: https://github.com/apache/druid/pull/16307#discussion_r1570954139


##########
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:
   @LakshSingla This is going to be logged only if the table is empty, so I 
think it should be fine.



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