[CDAP-21075] Support DP 2.2(spark 3.5.1) by checking if the new method is present or not. #15808
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.
We need to support both Dataproc
2.2
( spark3.5.1
) and2.1
(spark3.3.2
).There were few refactoring and breaking API changes in SPARK-44531 .
Changed the spark version in CDAP to
3.5.1
just to check compilation failures and it resulted in only 1 Error in out code base i.e.OpaqueDatasetCollection#toDataframeCollection
In which we were using
RowEncoder.apply(StructType)
which is no longer present.Also testing with DP 2.2 with a suitable pipeline (Dedup --> Join) gives
java.lang.NoSuchMethodError
for that code path, rest of the testing went fine.Based on above points, we can say this is the only code path that requires change.
Fix in this pr:
Using reflection we are first determining if new method is present, if so , it is Spark 3.5.1 and we use the following code via reflection to achieve the Encoder :