Commit c7dcd26
authored
add type checking (#6284)
This commit adds type checking to the semantic analyzer thus bringing
static typing to dynamic data. As far as we know, this has not been
done before in a general fashion in any SQL-like query language for
dynamically typed data (e.g., SQL++, Asterix, search languages, etc).
This works by computing fused types of each operator's output and propagating
these types in a dataflow analysis. When types are unknown, the
analysis flexibly models them as having any possible type. The CSUP
and BSUP formats for dynamically typed data will be updated in future PRs
to include fused-type information so robust type checking can be carried
out for any super-structured data.
Type checking for built-in functions and aggregate functions is not
yet done as we need support from the functions packages to provide type
signatures. This will be done in a subsequent PR.
Many existing tests were updated since they had problematic type behavior.
A number of new tests were added to test the type checker but coverage
is light.1 parent 525853d commit c7dcd26
File tree
36 files changed
+1260
-56
lines changed- compiler
- semantic
- sem
- ztests
- sfmt/ztests
- ztests
- db/ztests
- runtime
- sam
- expr
- op/ztests
- ztests
- expr
- op
- sio
- arrowio
- parquetio
36 files changed
+1260
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
0 commit comments