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



##########
File path: contrib/storage-http/README.md
##########
@@ -45,6 +45,30 @@ The `connection` property can accept the following options.
 
 `url`: The base URL which Drill will query.
 
+##### Parameters in the URL
+Many APIs require parameters to be passed directly in the URL instead of as 
query arguments.  For example, github's API allows you to query an 
organization's repositories with the following
+URL:  https://github.com/orgs/{org}/repos
+
+As of Drill 1.20.0, you can simply set the URL in the connection using the 
curly braces.  If your API includes URL parameters you MUST
+include them in the `WHERE` clause in your query, or Drill will throw an 
error. 
+
+As an example, the API above, you would have to query as shown below:
+
+```sql
+SELECT * 
+FROM api.github
+WHERE org = 'apache'
+```
+
+This query would replace the `org`in the URL with the value from the `WHERE` 
clause, in this case `apache`.  You can specify a default value as follows:  
`https://someapi.com/
+{param1}/{param2=default}`.  In this case, the default would be used if and 
only if there isn't a parameter supplied in the query. 
+
+#### Limitations on URL Parameters
+* Drill does not support combinations of parameters in queries.  For instance, 
for the above example, you could not include `WHERE org='apache' OR org='linux'`

Review comment:
       Ah yes.. I'll update the docs.  What I was getting at here was that the 
pushdowns for this do not support boolean expressions.  In theory we could 
parallelize that so that if someone wrote a query that had a series of `OR` 
conditions, that would be parallelized, but we'll save that for another PR. ;-)




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