Commit c9c8fb7
authored
Pushdown some expressions to Dict layout reader (#8341)
When we access values of Dict layout reader, it canonicalizes them and
stores
them in a SharedArray. This means we always pay the cost of
canonicalization
which in turn means we can't do
#8310 .
In order to solve this issue, we need to apply some expressions to the
values
array before canonicalizing it. However, we can't push down arbitrary
expressions as it may be beneficial to apply them over canonicalized
array.
One example of such expressions is LIKE over a Dict array with few codes
used.
Applying LIKE to whole values array is not beneficial.
This PR adds a hardcoded internal is_negative_cost estimation for
expressions
that we want to push before canonicalization. A hint for these are
expressions
which don't depend on individual input size. As an example, for every
string,
len(string) doesn't read the string itself but reads the metadata and
thus is
O(1) on individual input.
We don't push down fallible (like cast) or null sensitive (like IS NULL)
expressions as well because we want to propagate the errors at call site
rather than upfront.
Signed-off-by: Mikhail Kot <[email protected]>1 parent 31fda42 commit c9c8fb7
4 files changed
Lines changed: 283 additions & 9 deletions
File tree
- vortex-array/src
- expr
- analysis
- transform
- scalar_fn
- vortex-layout/src/layouts/dict
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
45 | 64 | | |
46 | 65 | | |
47 | 66 | | |
| |||
50 | 69 | | |
51 | 70 | | |
52 | 71 | | |
| 72 | + | |
53 | 73 | | |
54 | 74 | | |
55 | 75 | | |
| |||
70 | 90 | | |
71 | 91 | | |
72 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
73 | 96 | | |
74 | 97 | | |
75 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
53 | 65 | | |
54 | 66 | | |
55 | | - | |
56 | | - | |
| 67 | + | |
| 68 | + | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
0 commit comments