-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-25267][SQL][TEST] Disable ConvertToLocalRelation in the test cases of sql/core and sql/hive #22270
[SPARK-25267][SQL][TEST] Disable ConvertToLocalRelation in the test cases of sql/core and sql/hive #22270
Changes from all commits
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 |
---|---|---|
|
@@ -40,6 +40,7 @@ import org.apache.spark.sql.test.{ExamplePoint, ExamplePointUDT, SharedSQLContex | |
import org.apache.spark.sql.test.SQLTestData.{NullInts, NullStrings, TestData2} | ||
import org.apache.spark.sql.types._ | ||
import org.apache.spark.util.Utils | ||
import org.apache.spark.util.random.XORShiftRandom | ||
|
||
class DataFrameSuite extends QueryTest with SharedSQLContext { | ||
import testImplicits._ | ||
|
@@ -1729,10 +1730,8 @@ class DataFrameSuite extends QueryTest with SharedSQLContext { | |
} | ||
|
||
test("SPARK-9083: sort with non-deterministic expressions") { | ||
import org.apache.spark.util.random.XORShiftRandom | ||
|
||
val seed = 33 | ||
val df = (1 to 100).map(Tuple1.apply).toDF("i") | ||
val df = (1 to 100).map(Tuple1.apply).toDF("i").repartition(1) | ||
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. Sorry I didn't follow this thread closely. Why do we need these repartition(1) changes? 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. @cloud-fan I was just trying get this test case to pass when 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. BTW, do we still test the local relation conversion, which might be more common to users 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. @HyukjinKwon We are leaving this optimization on for MLTest as of now. Should we open it up for TestHive and keep it disabled it for SharedSparkSession ? cc @gatorsmile 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 with this change It's okay. Was wondering if we actually make the coverage lower for local relation specifically, or if some other tests should be added additionally. |
||
val random = new XORShiftRandom(seed) | ||
val expected = (1 to 100).map(_ -> random.nextDouble()).sortBy(_._2).map(_._1) | ||
val actual = df.sort(rand(seed)).collect().map(_.getInt(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.
re: #22270 (comment)
Didn't we disable the local relation test? Why don't we catch explicit
SparkExection
?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.
@HyukjinKwon Yeah... we could have caught SparkException here. My intention was to have this test case pass both when location relation optimization is on and off. Thats why i changed it a a generic exception along with verifying the error text.