rubenada commented on code in PR #5334:
URL: https://github.com/apache/calcite/pull/5334#discussion_r4400543570
##########
core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java:
##########
@@ -532,6 +532,39 @@ public final class CalciteSystemProperty<T> {
public static final CalciteSystemProperty<String> MODEL_BASE_DIRECTORY =
stringProperty("calcite.model.baseDirectory", "");
+ /**
+ * Regular expression that a remote URL in a file adapter table {@code url}
+ * operand must match for the adapter to dereference it (for example
+ * {@code -Dcalcite.file.urls.allowed=https://data\.example\.com/.*}).
+ * Empty by default: only local {@code file:} sources are dereferenced.
+ *
+ * <p>The expression uses {@link java.util.regex.Pattern} syntax and must
+ * match the whole URL, as written in the operand. Use {@code |} to allow
+ * several sites, for example
+ * {@code https://data\.example\.com/.*|http://data\.example\.com:8080/.*}.
+ * Matching is case-sensitive (use {@code (?i)} to ignore case), and the URL
+ * is not normalized first: default ports, {@code .} and {@code ..} segments
+ * and percent-encoding are compared as written. Escape each {@code .} in a
+ * host name, and end the host with {@code /} (or {@code :port/}), so that
+ * {@code https://data\.example\.com/.*} does not match
+ * {@code https://data.example.com.other.org/} nor
+ * {@code https://[email protected]/}.
+ *
+ * <p>A {@code file:} URL that names a host (for example
+ * {@code file://host/share/t.csv}, which Windows resolves to a UNC path) is
+ * remote, and is dereferenced only if the expression matches it.
+ * {@code jar:} URLs are considered remote even when they wrap a local
+ * {@code file:} URL; the expression is matched against the whole
+ * {@code jar:} URL (for example {@code jar:file:/opt/app/lib/.*}).
Review Comment:
rephrased
##########
core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java:
##########
@@ -532,6 +532,39 @@ public final class CalciteSystemProperty<T> {
public static final CalciteSystemProperty<String> MODEL_BASE_DIRECTORY =
stringProperty("calcite.model.baseDirectory", "");
+ /**
+ * Regular expression that a remote URL in a file adapter table {@code url}
+ * operand must match for the adapter to dereference it (for example
+ * {@code -Dcalcite.file.urls.allowed=https://data\.example\.com/.*}).
+ * Empty by default: only local {@code file:} sources are dereferenced.
+ *
+ * <p>The expression uses {@link java.util.regex.Pattern} syntax and must
+ * match the whole URL, as written in the operand. Use {@code |} to allow
+ * several sites, for example
+ * {@code https://data\.example\.com/.*|http://data\.example\.com:8080/.*}.
+ * Matching is case-sensitive (use {@code (?i)} to ignore case), and the URL
+ * is not normalized first: default ports, {@code .} and {@code ..} segments
+ * and percent-encoding are compared as written. Escape each {@code .} in a
+ * host name, and end the host with {@code /} (or {@code :port/}), so that
+ * {@code https://data\.example\.com/.*} does not match
+ * {@code https://data.example.com.other.org/} nor
+ * {@code https://[email protected]/}.
Review Comment:
done
--
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]