cgivre commented on a change in pull request #2270: URL: https://github.com/apache/drill/pull/2270#discussion_r691792957
########## File path: contrib/storage-http/README.md ########## @@ -45,6 +45,23 @@ 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`. Review comment: This is a question of how much bad user behavior we want to allow. I did write unit tests for all these conditions, and it does work. I also added default values per your suggestion. -- 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]
