From 50a6ea7b9f26e393033e360a0d5105854041d661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BD=A6=E9=92=8A?= <zhangyanzhao@igengmei.com> Date: Fri, 27 Sep 2019 14:00:44 +0800 Subject: [PATCH] add --- hello.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello.py b/hello.py index 6d428ae9..497ae0aa 100644 --- a/hello.py +++ b/hello.py @@ -33,7 +33,7 @@ if __name__ == '__main__': "AND partition_date='20190926' limit 20" df = spark.sql(sql) # df.show(6) - rdd = df.rdd.map(lambda x:str(x[0])).map(lambda x:eval(x)).map(lambda x:(ctr(x))) + rdd = df.rdd.map(lambda x:(str(x[0]))).map(lambda x:(eval(x))).map(lambda x:(ctr(x))) print(rdd.collect()) spark.createDataFrame(rdd).toDF("n").show(6) -- 2.18.0