agentm / project-m36

Project: M36 Relational Algebra Engine
The Unlicense
895 stars 48 forks source link

Lower-case basic types are not working. #204

Closed YuMingLiao closed 6 years ago

YuMingLiao commented 6 years ago

All the types described here are not working.

test result:

TutorialD (master/main): a::{a double,b datetime, c date, d bytestring}
TutorialD (master/main): :showexpr a
┌──────┬────────┬────┬──────────┐
│double│datetime│date│bytestring│
└──────┴────────┴────┴──────────┘

no double :: Double.

And values can't be inserted.

TutorialD (master/main): c::{a double}
TutorialD (master/main): insert c relation{tuple{a 1.2}}
ERR: AttributeNamesMismatchError (fromList ["a"])
agentm commented 6 years ago

Wow, that page is really outdated. I need to update it.

Thanks for the report!

agentm commented 6 years ago

What is actually happening above is that there the type validation is broken.

TutorialD (master/main): d:=relation{a invalidtype}{tuple{a 40}}
TutorialD (master/main): :showexpr d
┌───────────┐
│invalidtype│
├───────────┤
│40         │
└───────────┘

What a dumb mistake!

agentm commented 6 years ago

This issue was caused by insufficient type variable validation, namely that type variables were allowed to become types in relations.