[CHIP-9] fetcher refactor + support derivations in chaining #992
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.
Summary
Refactor fetch join calls and support derivations in chaining.
fetchJoin
into multiple sub-functions:fetchBaseJoin
,fetchDerivations
,fetchModelTransforms
andinstrumentAndLog
fetchJoin
fromJoinSourceRunner
into calling each sub-functions separatelyfetchDerivations
, use spark session to apply derivationsfetchBaseJoin
fetchModelTransforms
andinstrumentAndLog
Why / Goal
Currently, if a join contains derivations, it cannot be used as a joinSource for chaining, because in the chaining streaming job (
JoinSourceRunner
), spark executor will callfetcher.fetchJoin
which invokes its own local spark session, and Spark doesn't like this - results inCaused by: org.apache.spark.SparkException: Failed to get broadcast_1_piece0 of broadcast_1
Before model transforms chaining this is fine, because the same derivations can be expressed using GroupBy's query. But with model transforms chaining, running derivations as part of the join is a mandatory step to prepare model inputs. This is to be done together with UDF usage in derivations.
Test Plan
Checklist
Reviewers