abhioncbr commented on PR #10990:
URL: https://github.com/apache/pinot/pull/10990#issuecomment-1624572629

   > > Question: why do the min/max values with leading or trailing ` ` or with 
`,` are invalid?
   > 
   > Good question! IIRC, the limitation is introduced by the 
`PropertiesConfiguration` (from Apache Common library). Maybe we can 
work-around this limitation
   
   Thanks for the pointer. I was digging around the `PropertiesConfiguration`, 
and here are my understandings.
   - By default, PropertiesConfiguration has the ` = `(leading and trailing 
whitespace) as a key,value separator. As per the 
[doc](https://commons.apache.org/proper/commons-configuration/userguide_v1.10/howto_properties.html),
 we can either use the `setSeparator()` or `setGlobalSeparator()`
   - values having comma`,` is considered an array while reading, but we can 
escape the comma by adding `\\` in front of the comma.
   
   Lastly, here is the sample function for understanding the issue
   ```
   public static void main(String[] args)
         throws ConfigurationException {
       PropertiesConfiguration properties =
           new PropertiesConfiguration(new File("test"));
       String testValueWithWhitespace = "  aaa   ";
       properties.setProperty("a", testValueWithWhitespace);
   
       String testValueWithComma = "a\\,a\\,a";
       properties.setProperty("a1", testValueWithComma);
   
       properties.save();
   
       String readValue = (String)properties.getProperty("a");
       String readValue1 = (String)properties.getProperty("a1");
       System.out.printf("#%s#%n", readValue);
       System.out.printf("#%s#%n", readValue1);
       Assert.equals(testValueWithWhitespace, readValue);
     }
   ```
   The property file content for the above is as follows.
   ```
   a =           aaa   
   a1 = a\,a\,a
   
   ```
   
   I don't see the issue using the value with whitespace based on the above 
example, and for comma we can add the escape character. Please share your 
opinion. Thanks.


-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to