[Looky-7769] fix: pandas merge performace by filttered join#3
Merged
halconel merged 8 commits intoLooky-7769/offsetsfrom Nov 20, 2025
Merged
[Looky-7769] fix: pandas merge performace by filttered join#3halconel merged 8 commits intoLooky-7769/offsetsfrom
halconel merged 8 commits intoLooky-7769/offsetsfrom
Conversation
…ered join optimization
…uring incremental processing
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multi-table Filtered Join Optimization
Summary
This PR implements comprehensive optimizations for multi-table transformations using filtered join and offset-based change detection. The solution significantly improves performance by reading only relevant records from reference tables instead of full table scans.
Problem
Multi-table transformations with large reference tables (e.g., profiles, categories) were experiencing performance degradation:
Solution
1. Filtered Join Optimization (93f2685, ed77858)
join_keysparameter inComputeInputto enable filtered reading_get_additional_idx_columns()to collect join key columnsget_batch_input_dfs()to create filtered idx based onjoin_keysmappingadditional_columnstobuild_changed_idx_sql_v1/v2functions2. Additional Columns via Data Table Join (99353dc)
user_id) were not in meta-table, preventing filtered joinbuild_changed_idx_sql_v2to join meta-table with data-table3. Reverse Join for Reference Tables (95a2341)
join_keys4. Comprehensive Test Coverage (497adfa)
test_filtered_join_is_called- Verifies filtered join uses correct keys (spy pattern)test_join_keys_correctness- Validates join operates on specified keystest_v1_vs_v2_results_identical- Ensures v1 and v2 produce identical resultsPerformance Impact
API Changes
New Parameter: join_keys in ComputeInput
Backward Compatibility
join_keysis optionalTesting
Unit Tests
Linters
Files Changed
datapipe/step/batch_transform.py- Added filtered join logic and helper methodsdatapipe/meta/sql_meta.py- Implemented reverse join and additional columns supporttests/test_multi_table_filtered_join.py- Comprehensive test suite (NEW)Migration Guide
Before (reading all profiles):
After (filtered join):