paul-rogers commented on PR #13360:
URL: https://github.com/apache/druid/pull/13360#issuecomment-1345431728
@gianm, Got the array parameter thing working. Required an horrible amount
of Calcite hacking, but at least it works. This would be a good contribution
back to Calcite, once things stabilize. See example below.
We can accept parameter aliases, which is how I thought to address the long
name issue, once things stabilize. It is a nuisance to introduce that extra bit
of complexity while things are still in flux.
For HTTP, I changed the parameter names back to `userName`, `password` and
`passwordEnvVar`. Reason: we said that `httpAuthorizationPassword` doesn't work
for the two JSON cases, so we need new names. You suggested using shorter names
when the names don't directly map to JSON, as is the case here. That gives
`password` and `passwordEnvVar. I could not bring myself to leave
`httpAuthorizationUsername` (sic, with the lack of capitalization on "n"), so
changed that to `userName` as well. If folks get confused, we'll add the long
name as an alias in the future.
For the local input source, I added the desired functionality to the
catalog/table function layer. This allows a user to specify a base directory
and format in the catalog, and a set of files in a table function which are
relative to the base directory. The catalog code rewrites things into the
awkward form required by the local input source itself. Example, using just a
table function:
```sql
-- Gives /tmp/a.csv and /tmp/b.csv
localfiles(
baseDir => '/tmp',
files => ARRAY['a.csv', 'b.csv'],
format => 'csv')
```
With yet more Calcite hacking, array valued arguments can be given as
parameters:
```sql
localfiles(files => ?, format => 'csv')
```
The actual list of files can be given as a `List` or array via a query
parameter. This should simplify the user experience when an MSQ query is driven
by a script: just set a query parameter rather than mucking about with the JSON
inside of SQL in the body of the query.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]