Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join function #2728

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Join function #2728

wants to merge 25 commits into from

Conversation

anderson-joyle
Copy link
Contributor

@anderson-joyle anderson-joyle commented Nov 4, 2024

Join(t1, t2, LeftRecord.id = RightRecord.refid) //JoinType.Inner by default
Join(t1, t2, LeftRecord.id = RightRecord.refid, JoinType.Inner) // JoinType.Inner / JoinType.Left / JoinType.Right / JoinType.Full
Join(t1, t2, LeftRecord.id = RightRecord.refid, JoinType.Inner, LeftRecord.id As NewId, ...) // Renaming columns to avoid name collision

@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 5, 2024

✅ No public API change. #Resolved

@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 6, 2024

✅ No public API change. #Resolved

@anderson-joyle anderson-joyle changed the title WIP Join function Join function Nov 6, 2024
@anderson-joyle anderson-joyle marked this pull request as ready for review November 6, 2024 22:58
@anderson-joyle anderson-joyle requested a review from a team as a code owner November 6, 2024 22:58
@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 6, 2024

✅ No public API change. #Resolved

@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 7, 2024

✅ No public API change. #Resolved

@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 7, 2024

✅ No public API change. #Resolved

@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 19, 2024

✅ No public API change. #Resolved

@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 19, 2024

✅ No public API change. #Resolved

@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 20, 2024

✅ No public API change. #Resolved

@LucGenetier
Copy link
Contributor

LucGenetier commented Nov 21, 2024

✅ No public API change. #Resolved

@LucGenetier
Copy link
Contributor

✅ No public API change.

@CarlosFigueiraMSFT
Copy link
Contributor

CarlosFigueiraMSFT commented Nov 21, 2024

            for (var i = 1; i < carg; i++)

Suggestion: start from ScopeArgs instead of 1; we don't need to do any of the logic inside this loop for any of the scope arguments, since they have already been visited (we'd need to move line 4655 (argTypes[i] = _txb.GetType(args[i])) to line 4575 after we visited it


Refers to: src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs:4623 in a438704. [](commit_id = a438704, deletion_comment = False)

Table({Fruit:"Grapes",Price:220,Purchase:Date(2015,10,1),RowId:1,SupplierId:"AAA111"},{Fruit:"Lemons",Price:31,Purchase:Date(2015,10,1),RowId:2,SupplierId:"BBB222"},{Fruit:"Lemons",Price:29,Purchase:Date(2015,10,2),RowId:3,SupplierId:"AAA111"},{Fruit:"Grapes",Price:210,Purchase:Date(2015,10,2),RowId:4,SupplierId:"AAA111"},{Fruit:"Lemons",Price:30,Purchase:Date(2015,10,3),RowId:5,SupplierId:"BBB222"},{Fruit:"Bananas",Price:12,Purchase:Date(2015,10,3),RowId:6,SupplierId:"AAA111"},{Fruit:"Apples",Price:15,Purchase:Date(2015,12,3),RowId:7,SupplierId:"CCC333"},{Fruit:"Mangos",Price:30,Purchase:Date(2016,12,3),RowId:8,SupplierId:"DDD444"})

// Inner
>> Join(t1, t2, LeftRecord.Id = RightRecord.SupplierId, JoinType.Inner)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t1, t2

We should have tests for renaming the left/right scopes:

Join(
    t1 As MyLeft,
    t2 As MyRight,
    MyLeft.Id = MyRight.SupplierId,
    JoinType.Inner,
    MyRight.Fruit As Fruit)

@LucGenetier
Copy link
Contributor

✅ No public API change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants