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

temporal tables and distinct/dedup #1121

Open
vcgalpin opened this issue Mar 29, 2022 · 1 comment
Open

temporal tables and distinct/dedup #1121

vcgalpin opened this issue Mar 29, 2022 · 1 comment

Comments

@vcgalpin
Copy link

(Unsurprisingly) temporal tables and distinct/dedup don't play nicely together

links> query mixing { for (x <- distinct(malaria_stage2interaction_temporal)) [x] };
Unification error: Temporal table specifications Current and Transaction do not match.
<stdin>:1: Type error: The function
    `distinct'
has type
    `(TableHandle ((|a::Base),(|b::Base),(|c::Base))) {}-> [(|a::Base)]'
while the arguments passed to it have types
    `TemporalTable(Transaction,(interaction_id:Int,malaria_stage_id:Int),(interaction_id:Int,malaria_stage_id:Int),(interaction_id:Int,malaria_stage_id:Int))'
and the currently allowed effects are
    `'
In expression: distinct(malaria_stage2interaction_temporal).
links> length(query mixing { dedup(for (x <-t- malaria_stage2interaction) [x]) });
Unification error: Temporal table specifications Current and Transaction do not match.
<stdin>:1: Type error: The body of a table generator must have type `TemporalTable(Transaction,(|a::Base),(|b::Base),(|c::Base))', but the expression
    `malaria_stage2interaction'
has type
    `TemporalTable(Current,(interaction_id:Int,malaria_stage_id:Int),(interaction_id:Int,malaria_stage_id:Int),(interaction_id:Int,malaria_stage_id:Int))'
In expression: for (x <-t- malaria_stage2interaction) [x].

@SimonJF
Copy link
Member

SimonJF commented Mar 29, 2022

Hi Vashti, I wouldn't say this is a bug at present:

Unification error: Temporal table specifications Current and Transaction do not match.

This arises because the typechecker demands that the deduplication functionality requires a current-time table rather than a temporal one, so I'd say at present it's working as intended. That said, good to mark it as a feature request.

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

No branches or pull requests

3 participants