vvysotskyi commented on a change in pull request #1833: DRILL-6961: Handle 
exceptions during queries to information_schema
URL: https://github.com/apache/drill/pull/1833#discussion_r310651296
 
 

 ##########
 File path: 
contrib/storage-kafka/src/main/java/org/apache/drill/exec/store/kafka/schema/KafkaMessageSchema.java
 ##########
 @@ -76,11 +75,10 @@ public Table getTable(String tableName) {
     if (tableNames == null) {
       try (KafkaConsumer<?, ?> kafkaConsumer = new 
KafkaConsumer<>(plugin.getConfig().getKafkaConsumerProps())) {
         tableNames = kafkaConsumer.listTopics().keySet();
-      } catch(KafkaException e) {
-        throw UserException.dataReadError(e).message("Failed to get tables 
information").addContext(e.getMessage())
-            .build(logger);
+      } catch (Exception e) {
+        logger.warn("Failed to get tables information: {}", e.getMessage());
       }
     }
-    return tableNames;
+    return tableNames != null ? tableNames : Collections.emptySet();
 
 Review comment:
   `tableNames` can be `null` only for the case when the exception was caught. 
Is it makes sense to add return statement there and revert the change in this 
line?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to