[
https://issues.apache.org/jira/browse/CALCITE-4035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17121475#comment-17121475
]
David Hait commented on CALCITE-4035:
-------------------------------------
One limitation I see right away with the FileAdapter is that from what I can
see, it is not filterable, whereas this would be a key necessary element of a
REST api. And, the method of filtering can become quite complex (not just small
changes to the file name). The Csv Adapter might actually be closer to what we
want.
I will take a look at some variations on API's that we would want to support.
Unfortunately there are no good standards for how to construct the URI nor for
how to interpret the results. All this detail would need to go into the model
for the adapter. The goal here is that we would want to do this is a way that
does not require the user to go back to the maintainer of the web service and
ask them to change their API.
A simple server that generates JSON for testing in response to REST call is
quite straightforward. It could be embedded, or it could even be done
separately in Javascript (like Node.js and Express) if that is simpler.
> Adapter for REST interface with query or path parameters
> --------------------------------------------------------
>
> Key: CALCITE-4035
> URL: https://issues.apache.org/jira/browse/CALCITE-4035
> Project: Calcite
> Issue Type: New Feature
> Reporter: David Hait
> Priority: Major
>
> A typical microservice with a REST interface will be queryable by an HTTP GET
> with query parameters or path parameters, and return JSON. It would be
> useful to have an adapter that allows access to this sort of interface. One
> use case would be to allow a join between a database table and a table which
> represents the interface. SQL "where" items could be mapped to specific
> query parameters or path parameters on the web API.
> So, for example,
> {{ SELECT * from service.MyEndpoint where id=123;}}
> could get translated into
> {{ GET http:/service/MyEndpoint/123}}
> or alternatively
> {{ GET [http://service/MyEndpoint?id=123]}}
> The mapping between SQL terms and URL path would be specified in a model
> file.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)