expressions need to pass through expressions to DB's
As a proxy, expressions in SQL could potentially be evaluated in one of several points of the lifecycle:;
- Initial Proxy Routing/Evaluation context: ie proxy recieves sql, evaluate before passing through to datastore
- DataStore: pass through expressions to db, used for db's that support them natively, either as a function in db, or a translation such as mutations ie
col +1or set type operations in cassandra, n1ql or postgres or mongo - return, after returning data from datastore, before returning to requester, perform manipulations on it.
How to express these 3 different contexts? Currently I think only 1 is supported for update/insert/delete and 2 is not supported at all and 3 for select only.
UPDATE counterks.page_view_counts
SET counter_value = counter_value + 2
WHERE url_name='www.datastax.com' AND page_name='home';
CQL set operation
UPDATE users
SET emails = emails + {'[email protected]'} WHERE user_id = 'frodo';
- CQL http://docs.datastax.com/en/cql/3.1/cql/cql_reference/update_r.html
Hi, sorry for the questions unrelated to this concrete issue.
Could you say, is it possible to pass expressions/filters to a remote datasource with qlbridge?
For example, if I have a REST API like site.com/rest/users and query like select count(*) from users where name = "Joe", can I pass that filter name=Joe to the REST or I should get all users and then filter locally (like full table scan)?
That is not clear to me from the first glance, sorry =(
It is possible.
The exec package is the Query Runtime (a single thread query runtime).
It recognizes Sources (ie, each table name is from a source), each table name is loaded into a schema so that multiple tables can exist in same schema, from different sources.
Each Source TYPE must be implemented to do predicate pushdown (ie, rewrite queries to push down to underlying store). This implementation i call a Generator and basically involves walking the AST of the SQL to re-write and push down.
- This is an example for elasticsearch: https://github.com/araddon/qlbridge/pull/176
- for bigquery (different dialect of sql) https://github.com/dataux/dataux/tree/master/backends/bigquery
This ticket above is referring to the fact that WHICH functions to pass down (and which not to) needs to have a cleaner, better way of deciding.