Github user nchammas commented on a diff in the pull request:
https://github.com/apache/spark/pull/2369#discussion_r17510214
--- Diff: python/pyspark/tests.py ---
@@ -574,6 +574,34 @@ def test_broadcast_in_udf(self):
[res] = self.sqlCtx.sql("SELECT MYUDF('')").collect()
self.assertEqual("", res[0])
+ def test_basic_functions(self):
+ rdd = self.sc.parallelize(['{"foo":"bar"}', '{"foo":"baz"}'])
+ srdd = self.sqlCtx.jsonRDD(rdd)
+ srdd.count()
+ srdd.collect()
+ srdd.schemaString()
+ srdd.schema()
+
+ # cache and checkpoint
+ self.assertFalse(srdd.is_cached)
+ srdd.persist()
+ srdd.unpersist()
+ srdd.cache()
+ self.assertTrue(srdd.is_cached)
+ self.assertFalse(srdd.isCheckpointed())
+ self.assertEqual(None, srdd.getCheckpointFile())
+
+ srdd = srdd.coalesce(2, True)
+ srdd = srdd.repartition(3)
+ srdd = srdd.distinct()
--- End diff --
OK, I'll take your word for it but just point out that one of the reported
issues in SPARK-3500 was specifically that `distinct()` worked but
`distinct(n)` didn't. Since that is a possible failure mode, it probably makes
sense to have a test for each.
---
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]