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

allow for joins on mult columns, inequality joins, fix edge case with arrays #91

Merged
merged 8 commits into from
Jan 7, 2025

Conversation

drizk1
Copy link
Member

@drizk1 drizk1 commented Dec 22, 2024

  • Adds support for joining on multiple columns
  • Adds support for inequality joins
  • Adds support for AsOf / rolling joins Support asof join types #6
  • Equi-joins no longer duplicate key columns
  • Fixes bug to allow array columns to be mutated in

@drizk1 drizk1 changed the title adds join_by, fix edge case with arrays adds join_by, inequality joins, fix edge case with arrays Dec 23, 2024
@drizk1
Copy link
Member Author

drizk1 commented Dec 24, 2024

still trying to sort out how to drop the column safely without intro-ing bugs in equijoins

@drizk1 drizk1 changed the title adds join_by, inequality joins, fix edge case with arrays allow for joins on mult columns, inequality joins, fix edge case with arrays Dec 29, 2024
@drizk1
Copy link
Member Author

drizk1 commented Jan 7, 2025

Alright so I finally figured out how to make duplicate columns drop on equi joins but not inequality joins mimicking dplyr, without breaking any of the existing tests or functionality

Improves Asof joins are supported and match dplyr syntax (minus join_by) and removes user need to add table name

All syntax matches tidierdata ideal joins here

@kdpsingh I know TidierData has this in the works, but what are your thoughts about this merging and releasing before TidierData supports it? If join_by becomes needed I can retroactively add support

DB.@chain DB.t(holdings) begin

           DB.@left_join("prices", ticker, closest(when >= when))
                                     # or ticker = ticker
           DB.@select(holdings.ticker, holdings.when) 
           DB.@mutate(value = price * shares)
         @aside  DB.@show_query _
           DB.@collect
       end

@kdpsingh
Copy link
Member

kdpsingh commented Jan 7, 2025

Go for it! No need to wait for TidierData to catch up.

@drizk1 drizk1 merged commit d66c11f into main Jan 7, 2025
3 checks passed
@drizk1 drizk1 deleted the add-join_by branch January 9, 2025 15:56
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.

2 participants