You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2021/07/28 00:40:49 UTC

[GitHub] [drill] cgivre commented on a change in pull request #2270: DRILL-7970: Add URL Parameters to HTTP Plugin

cgivre commented on a change in pull request #2270:
URL: https://github.com/apache/drill/pull/2270#discussion_r677891935



##########
File path: contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpPushDownListener.java
##########
@@ -82,9 +85,20 @@ public ScanPushDownListener builderFor(GroupScan groupScan) {
 
     HttpScanPushDownListener(HttpGroupScan groupScan) {
       this.groupScan = groupScan;
+      // Add fields from config
       for (String field : groupScan.getHttpConfig().params()) {
         filterParams.put(field, field);
       }
+
+      // Add fields from the URL path as denoted by {}
+      HttpUrl url = HttpUrl.parse(groupScan.getHttpConfig().url());
+      if (url != null) {
+        List<String> urlParams = SimpleHttp.getURLParameters(url);
+        assert urlParams != null;

Review comment:
       Fixed.  I actually changed the `getUrlParameters()` method such that if it encounters any error, it returns an empty list rather than `null`.  My sense is that is better design. 




-- 
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: dev-unsubscribe@drill.apache.org

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