aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/sql/tests.py
diff options
context:
space:
mode:
authorDavies Liu <davies@databricks.com>2015-04-17 11:29:27 -0500
committerReynold Xin <rxin@databricks.com>2015-04-17 11:29:27 -0500
commitc84d91692aa25c01882bcc3f9fd5de3cfa786195 (patch)
tree7951bc6429ae21eb62de4ed6c6de658b379affde /python/pyspark/sql/tests.py
parentdc48ba9f9f7449dd2f12cbad288b65c8119d9284 (diff)
downloadspark-c84d91692aa25c01882bcc3f9fd5de3cfa786195.tar.gz
spark-c84d91692aa25c01882bcc3f9fd5de3cfa786195.tar.bz2
spark-c84d91692aa25c01882bcc3f9fd5de3cfa786195.zip
[SPARK-6957] [SPARK-6958] [SQL] improve API compatibility to pandas
``` select(['cola', 'colb']) groupby(['colA', 'colB']) groupby([df.colA, df.colB]) df.sort('A', ascending=True) df.sort(['A', 'B'], ascending=True) df.sort(['A', 'B'], ascending=[1, 0]) ``` cc rxin Author: Davies Liu <davies@databricks.com> Closes #5544 from davies/compatibility and squashes the following commits: 4944058 [Davies Liu] add docstrings adb2816 [Davies Liu] Merge branch 'master' of github.com:apache/spark into compatibility bcbbcab [Davies Liu] support ascending as list 8dabdf0 [Davies Liu] improve API compatibility to pandas
Diffstat (limited to 'python/pyspark/sql/tests.py')
-rw-r--r--python/pyspark/sql/tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/pyspark/sql/tests.py b/python/pyspark/sql/tests.py
index 6691e8c8dc..aa3aa1d164 100644
--- a/python/pyspark/sql/tests.py
+++ b/python/pyspark/sql/tests.py
@@ -282,7 +282,7 @@ class SQLTests(ReusedPySparkTestCase):
StructField("struct1", StructType([StructField("b", ShortType(), False)]), False),
StructField("list1", ArrayType(ByteType(), False), False),
StructField("null1", DoubleType(), True)])
- df = self.sqlCtx.applySchema(rdd, schema)
+ df = self.sqlCtx.createDataFrame(rdd, schema)
results = df.map(lambda x: (x.byte1, x.byte2, x.short1, x.short2, x.int1, x.float1, x.date1,
x.time1, x.map1["a"], x.struct1.b, x.list1, x.null1))
r = (127, -128, -32768, 32767, 2147483647, 1.0, date(2010, 1, 1),