linghengqian commented on code in PR #29704:
URL: https://github.com/apache/shardingsphere/pull/29704#discussion_r1452129719


##########
jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/AbsolutePathURLProvider.java:
##########
@@ -55,10 +57,28 @@ public byte[] getContent(final String url, final String 
urlPrefix) {
             String line;
             while (null != (line = reader.readLine())) {
                 if (!line.startsWith("#")) {
+                    line = replaceVariables(line);
                     builder.append(line).append('\n');
                 }
             }
             return builder.toString().getBytes(StandardCharsets.UTF_8);
         }
     }
+    
+    private String replaceVariables(final String line) {
+        Pattern variablePattern = Pattern.compile("\\$\\{(.+?)\\}");

Review Comment:
   - The regular expression `${(.+?)}` appears to conflict with the syntax 
involved in the Groovy implementation of Row Value Expressions. Maybe replace 
it with `#{(.+?)}`? Refer to 
https://shardingsphere.apache.org/document/current/en/user-manual/common-config/builtin-algorithm/expr/
 .
   - Or other grammar recognition?
   - I added separate documentation in #29730, it seems good to add two 
separate implementation for `#{(.+?)}`, a non-standard way of identifying 
environment variables. What do you think?



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

Reply via email to