project-m36
project-m36 copied to clipboard
AtomFunction max doesn't type check.
Hi, I may found an issue when trying atom functions.
In tuorial, max
is for int.
in code, max
is defined for IntegerAtom
but it doesn't work for IntegerAtom as I expected.
TutorialD (master/main): :importexample date
TutorialD (master/main): :showexpr s
┌──────────┬────────┬───────────┬───────────────┐
│city::Text│s#::Text│sname::Text│status::Integer│
├──────────┼────────┼───────────┼───────────────┤
│"London" │"S4" │"Clark" │20 │
│"Athens" │"S5" │"Adams" │30 │
│"Paris" │"S3" │"Blake" │30 │
│"Paris" │"S2" │"Jones" │10 │
│"London" │"S1" │"Smith" │20 │
└──────────┴────────┴───────────┴───────────────┘
TutorialD (master/main): :showexpr s where status = 30
┌──────────┬────────┬───────────┬───────────────┐
│city::Text│s#::Text│sname::Text│status::Integer│
├──────────┼────────┼───────────┼───────────────┤
│"Paris" │"S3" │"Blake" │30 │
│"Athens" │"S5" │"Adams" │30 │
└──────────┴────────┴───────────┴───────────────┘
TutorialD (master/main): :showexpr s where status = max (@status)
┌──────────┬────────┬───────────┬───────────────┐
│city::Text│s#::Text│sname::Text│status::Integer│
└──────────┴────────┴───────────┴───────────────┘
Take a look at the test. Aggregate operators work on (nested) relations.
The type checker should be complaining in your example above, however.
Oops. I misunderstood again. Thanks for the reminder.