You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/11/19 01:46:07 UTC

[GitHub] [incubator-druid] gianm commented on a change in pull request #8876: fix sql compatible null handling config work with runtime.properties

gianm commented on a change in pull request #8876: fix sql compatible null handling config work with runtime.properties
URL: https://github.com/apache/incubator-druid/pull/8876#discussion_r347696170
 
 

 ##########
 File path: core/src/main/java/org/apache/druid/common/config/NullHandling.java
 ##########
 @@ -50,9 +49,17 @@
    * It does not take effect in all unit tests since we don't use Guice Injection.
    */
   @Inject
-  private static NullValueHandlingConfig INSTANCE = new NullValueHandlingConfig(
-      Boolean.valueOf(System.getProperty(NULL_HANDLING_CONFIG_STRING, "true"))
-  );
+  private static NullValueHandlingConfig INSTANCE;
 
 Review comment:
   I suggest making a private `getInstance()` method, using that everywhere, and having that method throw a nice exception that asks you to either call `NullHandling.initializeForTests()` or include `NullHandlingModule`. That way, future benchmark and test writers don't get confused by null pointer exceptions.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org