You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(field_index): get field index w.r.t. pre-join table schemata (#1078)
* fix(field_index): get field index w.r.t. pre-join table schemata
JoinChains provide the schema of the joined table (which is great for Ibis)
but for substrait we need the Field index computed with respect to
the original table schemata. In practice, this means rolling through
the tables in a JoinChain and computing the field index _without_
removing the join key
Given
Table 1
a: int
b: int
Table 2
a: int
c: int
JoinChain[r0]
JoinLink[inner, r1]
r0.a == r1.a
values:
a: r0.a
b: r0.b
c: r1.c
If we ask for the field index of `c`, the JoinChain schema will give
us an index of `2`, but it should be `3` because
0: table 1 a
1: table 1 b
2: table 2 a
3: table 2 c
So now we pull out the correct JoinReference object and use that to
index into the tables in the JoinChain and offset by the length of the
schema of those preceding tables.
* test(snapshots): update snapshots for fixed join indexing
* fix: apply suggestions from review
Co-authored-by: Phillip Cloud <[email protected]>
---------
Co-authored-by: Phillip Cloud <[email protected]>
0 commit comments