使用saveAsTable命令使用HiveContext保存sparkR数据帧

时间:2015-08-03 06:04:12

标签: apache-spark dataframe apache-spark-sql sparkr

使用saveAsTable命令

使用HiveContext时如何保存sparkR数据帧
df_5 <- loadDF(sqlContext, "Report02_cashier_Hourly_total_Trans_july30.parquet", "parquet")  /*I loaded the parquet file as dataframe*/
sqlContext <- sparkRHive.init(sc) /*Initialized the hive context*/

sql(sqlContext, "create table Report2_cashier_hourly (location_code INT, business_date DATE, cashier STRING, hour STRING, store_no STRING, region STRING, city STRING, zone STRING, Total_trans INT)") /*created a table Report2_cashier_hourly*/

如何使用saveAsTable(df, tableName, source, mode, ...)df_5(data frame)保存到配置单Report02_cashier_hourly中。

0 个答案:

没有答案