-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
6 changed files
with
129 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters