Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orderby in the context of temporal tables #1125

Open
vcgalpin opened this issue Apr 1, 2022 · 2 comments
Open

orderby in the context of temporal tables #1125

vcgalpin opened this issue Apr 1, 2022 · 2 comments

Comments

@vcgalpin
Copy link

vcgalpin commented Apr 1, 2022

Using the valid-time database from tests/shredding/validtime.links, the following error occurs when using the temporal
data projection function to select a field for sorting:

links> query nested { for (x <-v- employees) orderby (vtData(x).salary) [vtData
***: Error: "Assert_failure core/query/query.ml:446:12" 

This also happens with either of the time projection functions:

links> query nested { for (x <-v- employees) orderby (vtFrom(x)) [vtData(x)] };
***: Error: "Assert_failure core/query/query.ml:446:12" 
@jamescheney
Copy link
Contributor

This isn't tremendously surprising, since orderby is supported only by the flat query policy.

Since temporal queries are using "query nested" only to benefit from record flattening (i.e. nested records) at the moment, a shorter-term workaround would be to augment flat queries with support for record flattening too (this transformation is straightforward and ought to be easy to adapt to deduplication queries too).

@SimonJF
Copy link
Member

SimonJF commented Apr 1, 2022

I'm not sure what the semantics would be given the temporal data dimension. I think that really we should only allow orderby on timeslices of temporal tables, i.e.,

query nested { for (x <- vtCurrent(employees)) orderby (x.salary) [x] };

Regardless, this should be caught by a type error rather than a runtime error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants