You can translate the question and the replies:

Push down filter to JSON data source

Hi Team, I have a scenario where a REST API exposing large volume of data which required to be configured in Denodo as data source. We are able to achieve this by using JSON data souce and HTTP client. The data volume is high, hence filter conditions must be pushed down where applicable. The API provides $filter query parameter which can take complex where clause condition on JSON fields (similar to REST WS provided by Denodo). How to push the entire where clause on base view to JSON Data source on $filter query parameter? I tried with @WHEREEXPRESSION, but looks like it works only for JDBC data sources. Could you please let me know an alternative other than writing custom wrapper of our own? "select * from baseview where xyz = 1" should pushed down like http://apiendpoint?$filter=xyz%3D1 Thanks.
user
06-07-2021 18:16:47 -0400

3 Answers

Hi, you can refer to the similar case below: [Rest API as a Data Source with push down optimization](https://community.denodo.com/answers/question/details?questionId=9064u000000L8UvAAK&title=Rest+API+as+a+Data+Source+with+push+down+optimization) Hope this helps!
Denodo Team
08-07-2021 03:03:44 -0400
Thanks. But its not quite the same. In case I have to push down a specific condition, ex: select * from baseview where xyz = 123, as http://apiendpoint?xyz=123, I would use @xyz as interpolation variable, in that case the JSON Datasource URL will be http://apiendpoint?xyz=@xyz. This works, but the scenario I mentioned is different. The API endpoint does not take the colum name as query parameter, instead it takes a generic "$filter" as a query parameter with complete where statement. Is it possible to use @WHEREEXPRESSION with JSON data source? Regards, Sripathi
user
08-07-2021 03:58:56 -0400
Hi, “@WHEREEXPRESSION” is used when you create a base view from JDBC or ODBC datasource. The variable replaces “@WHEREEXPRESSION” with predefined where conditions. You can find more details in the “WHEREEXPRESSION” section of the page below. [Using the Create Base View From Query Option](https://community.denodo.com/kb/en/view/document/Using%20the%20Create%20Base%20View%20From%20Query%20Option?tag=Data+Sources) For adding datasource-specific expressions for JSON data source, you can also use the POST BODY option. You can refer to the page below for more information. [Error creating JSON data source with "POST Body" parameters](https://community.denodo.com/kb/en/view/document/Error%20creating%20JSON%20data%20source%20with%20%22Post%20Body%22%20parameters) Hope this helps!
Denodo Team
15-07-2021 02:33:44 -0400
You must sign in to add an answer. If you do not have an account, you can register here