Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/3827#discussion_r22648661
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
---
@@ -195,4 +196,19 @@ class SQLQuerySuite extends QueryTest {
checkAnswer(sql("SELECT sum( distinct key) FROM src group by key order
by key"),
sql("SELECT distinct key FROM src order by key").collect().toSeq)
}
+
+ test("SPARK-4963 SchemaRDD sample on mutable row return wrong result") {
+ sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)")
+ val location =
+ Utils.getSparkClassLoader.getResource("data/files/kv1.txt").getFile()
+ sql(s"LOAD DATA LOCAL INPATH '$location' INTO TABLE src")
+ sql("SELECT * FROM src WHERE key % 2 = 0")
+ .sample(withReplacement = false, fraction = 0.3)
+ .registerTempTable("sampled")
+ (1 to 10).foreach{ i =>
--- End diff --
Nit: space before `{`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]