-
Notifications
You must be signed in to change notification settings - Fork 230
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
Add ability to ignore tests depending on spark shim version #504
Conversation
Signed-off-by: Andy Grove <andygrove@nvidia.com>
build |
case SparkShimVersion(major, minor, _) => | ||
// this test is not valid in Spark 3.1 and later because the expression is | ||
// NullIntolerant and gets replaced with a null literal instead | ||
val isValidTestForSparkVersion = major <= 3 && minor == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although it seems unnecessary to have this separate variable, it makes the output message more obvious:
Test Canceled: isValidTestForSparkVersion was false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the SparkShimServiceProvider in each of the directories already has a VERSIONNAME string in it. It would be nice if we didn't have to duplicate it twice. Also you are missing the 300 databricks version here. I assume you added the class DatabricksShimVersion for it? we may need more information for databricks - runtime - we can always extend it later though as well.
Signed-off-by: Andy Grove <andygrove@nvidia.com>
I wasn't sure how this would work with Databricks or what the version numbers would be. The case classes might give us more flexibility than strings and could perhaps use these instead of the string for version name? I pushed another commit to demonstrate how I imagined this working for databricks. |
we can use the case classes as the real version and then have it have a function toString, that is used in SparkShimServiceProvider for now. That way we don't have the version in 2 places. I would like to add it to the databricks version as well. I don't want to have to fix it afterwards. Have it run the tests for it as it is now and the test is passing. They only changed this in 3.1 and so far 7.0 databricks runtime doesn't have that change. If the test ends up failing we can handle it separate but I would at least like to make an attempt here otherwise compilation will fail. The databricks version is just 3.0.0-databricks. It is not 7.0 which is the runtime version. The downside to having different case classes is demonstrated here, where you would have to match on both. If we had a "vendor" field in SparkShimVersion you could conditionalize that. In this case your check (noticed extra _) I think either way we will have to enhance the databricks version and probably this anyway to handle cases where the version is like 3.0.0.0 - but there is a separate jira for that. |
Signed-off-by: Andy Grove <andygrove@nvidia.com>
Thanks @tgravescs I hadn't realized that the databricks shim was already merged in. I have made those updates although this change has turned out larger than I originally thought. Let me know what you think. I'm happy to take a different approach if this is too disruptive. |
...park300/src/main/scala/com/nvidia/spark/rapids/shims/spark300/SparkShimServiceProvider.scala
Outdated
Show resolved
Hide resolved
...park301/src/main/scala/com/nvidia/spark/rapids/shims/spark301/SparkShimServiceProvider.scala
Outdated
Show resolved
Hide resolved
...park310/src/main/scala/com/nvidia/spark/rapids/shims/spark310/SparkShimServiceProvider.scala
Outdated
Show resolved
Hide resolved
overall I think this is fine, few minor nits. We can enhance it as we need. |
build |
Signed-off-by: Andy Grove <andygrove@nvidia.com>
build |
@tgravescs I addressed those nits |
* Add ability to ignore tests depending on spark shim version Signed-off-by: Andy Grove <andygrove@nvidia.com> * better version check Signed-off-by: Andy Grove <andygrove@nvidia.com> * remove duplicate VERSION strings and use case classes instead Signed-off-by: Andy Grove <andygrove@nvidia.com> * fix formatting Signed-off-by: Andy Grove <andygrove@nvidia.com>
* Add ability to ignore tests depending on spark shim version Signed-off-by: Andy Grove <andygrove@nvidia.com> * better version check Signed-off-by: Andy Grove <andygrove@nvidia.com> * remove duplicate VERSION strings and use case classes instead Signed-off-by: Andy Grove <andygrove@nvidia.com> * fix formatting Signed-off-by: Andy Grove <andygrove@nvidia.com>
* adding clang-format for cpp files Signed-off-by: Mike Wilson <knobby@burntsheep.com>
Signed-off-by: Andy Grove andygrove@nvidia.com
Adds the ability to ignore scala tests conditionally, depending on the version of Spark we are testing with.
Also closes #382