machristie opened a new issue, #5:
URL: https://github.com/apache/airavata-data-catalog/issues/5

   We want to use https://calcite.apache.org/ to take a high-level SQL query 
that is written against a metadata schema and translate that into the actual 
PostgreSQL query.
   
   From the design doc, we want to take something like this
   
   ```sql
   SELECT *
   FROM smilesdb
   WHERE created_date > '2020-01-01' AND absorb < 300.0
   ORDER BY created_date desc
   LIMIT 10;
   ```
   
   and transform it into this
   
   ```sql
   SELECT
       dp.*
   FROM
       data_product dp
       INNER JOIN data_product_metadata_schema dpms ON dp.data_product_id = 
dpms.data_product_id
       INNER JOIN metadata_schema ms ON ms.metadata_schema_id = 
dpms.metadata_schema_id
   WHERE
       nullif(metadata ->> 'absorb', '') :: float < 300.0
       AND created_date > '2020-01-01'
       AND ms.schema_name = 'smilesdb';
   ```
   
   Note: the query above is missing an authorization where clause, but I think 
for the initial investigation being able to produce the above query will be 
sufficient.


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