Commit d458f5e8 authored by 张彦钊's avatar 张彦钊

修改测试文件

parent 021b2dbc
...@@ -199,12 +199,13 @@ def con_sql(db,sql): ...@@ -199,12 +199,13 @@ def con_sql(db,sql):
def test(): def test():
sql = "select stat_date,cid_id,y,ccity_name from esmm_train_data limit 60" sql = "select stat_date,cid_id,y,ccity_name from esmm_train_data limit 60"
rdd = spark.sql(sql).select("stat_date","cid_id","y","ccity_name").rdd rdd = spark.sql(sql).select("stat_date","cid_id","y","ccity_name").rdd
spark.createDataFrame(rdd).show(6) df = spark.createDataFrame(rdd).map(lambda x:(x[0],x[1],x[2],x[3]))
df.show(6)
from hdfs import InsecureClient from hdfs import InsecureClient
from hdfs.ext.dataframe import read_dataframe from hdfs.ext.dataframe import read_dataframe
client = InsecureClient('http://nvwa01:50070') client = InsecureClient('http://nvwa01:50070')
df = read_dataframe(client,"/recommend/native/part-00199-f83757ab-9f64-4a2c-9f27-0b76df51c1c4-c000.avro") df = read_dataframe(client,"/recommend/native/part-00196-f83757ab-9f64-4a2c-9f27-0b76df51c1c4-c000.avro")
print(df.head()) print(df.head())
# print(df.count()) # print(df.count())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment