-
Notifications
You must be signed in to change notification settings - Fork 166
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
test: Fix explain with exteded info comet test #436
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,7 +249,7 @@ abstract class CometTestBase | |
var dfSpark: Dataset[Row] = null | ||
withSQLConf( | ||
CometConf.COMET_ENABLED.key -> "false", | ||
"spark.sql.extendedExplainProvider" -> "") { | ||
"spark.sql.extendedExplainProviders" -> "") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could we make this literal as a constant filed in this CometTestBase such as how we define It could be reused in CometExpressionSuite.scala as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, and do we really need to pass this param with blank value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks,
I added the constant in a shim because it is defined in Spark 4.0
Yes, the caller of this method ( |
||
dfSpark = Dataset.ofRows(spark, df.logicalPlan) | ||
expected = dfSpark.collect() | ||
} | ||
|
@@ -259,7 +259,7 @@ abstract class CometTestBase | |
dfSpark.queryExecution.explainString(ExtendedMode), | ||
dfComet.queryExecution.explainString(ExtendedMode)) | ||
if (supportsExtendedExplainInfo(dfSpark.queryExecution)) { | ||
assert(diff.contains(expectedInfo)) | ||
assert(expectedInfo.exists(s => diff.contains(s))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need to have all expected info in the diff? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks Updated |
||
} | ||
val extendedInfo = | ||
new ExtendedExplainInfo().generateExtendedInfo(dfComet.queryExecution.executedPlan) | ||
|
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 even we don't config it, the test still can pass?
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.
Currently it passes because, before Spark 4.0,
supportsExtendedExplainInfo
inCometTestBase.scala
is alwaysfalse
.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.
I meant previously the config name is wrong, so the config doesn't apply at all. So no matter with or without this config, this test passes?
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.
Correct, it passes with or without this config for Spark 3.x because the test is disabled by
supportsExtendedExplainInfo
that isfalse
.For Spark 4.0 or any Spark fork that implements the extended info,
supportsExtendedExplainInfo
returns true. Then it fails with the previous wrong config name.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.
Hmm, but we don't run tests against Spark 4.0 currently, right?
Although it is okay for this PR as it is to fix incorrect config name, it sounds a little strange to have a test that can pass no matter what.
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.
Maybe we should move this test to Spark 4.0 particular test folder later.
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.
There is another part in the same test that is valid for all Spark versions.
Perhaps, we can consider separating them out in the future cc @parthchandra
Thanks for reviewing
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.
Will do that @kazuyukitanimura