SEKIRO-J commented on a change in pull request #8465: disallow whitespace 
characters in data source names
URL: https://github.com/apache/incubator-druid/pull/8465#discussion_r321511377
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/segment/indexing/DataSchema.java
 ##########
 @@ -104,11 +106,13 @@ static void validateDatasourceName(String dataSource)
         !Strings.isNullOrEmpty(dataSource),
         "dataSource cannot be null or empty. Please provide a dataSource."
     );
-    Preconditions.checkArgument(!dataSource.contains("/"), "dataSource cannot 
contain the '/' character.");
+    Pattern p = Pattern.compile("(?s).*[^\\S ].*");
 
 Review comment:
   I've cached the compiled pattern, it can't be simple `".*\s.*"` because `\s` 
matches all whitespace including space, and we want to allow space.

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


With regards,
Apache Git Services

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

Reply via email to