tspurway / hustle

A column oriented, embarrassingly distributed relational event database.
Other
240 stars 36 forks source link

where clause only allows column expressions with literals #6

Open tspurway opened 10 years ago

tspurway commented 10 years ago

The following query is currently illegal in Hustle, as we don't allow Columns to be right side operands in Column expressions:

select(t.c1, where=t.c2 > t.c3)

Note that is is a much different issue when the two columns are from different Tables, as this would have to be done at a later stage than restrict-select, where all of the current Column expressions are evaluated

ncloudioj commented 10 years ago

Experimentally implemented this feature in commit 7870a1c483834ea921d372a121044b6fa1f46fe1. Need more work to finalize it.

Currently, you can compare two columns in the 'check' clause just like 'where' clause does,

select(imps.ad_id, pix.amount,
           where=(imps.date < '2014-01-13', pix.date < '2014-01-13'),
           join="site_id",
           check=(imps.token == pix.token) & (imps.date < pix.date) | ~(imps.time > pix.time))