5

How to save sparkR data frame when working with HiveContext using saveAsTable command

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*/

How to use saveAsTable(df, tableName, source, mode, ...) to save the df_5(data frame) into a hive table Report02_cashier_hourly.

zx8754
  • 52,746
  • 12
  • 114
  • 209
Arun Gunalan
  • 814
  • 7
  • 26
  • Kindly refer for answer [http://stackoverflow.com/questions/39129835/loading-sparkr-data-frame-in-hive](http://stackoverflow.com/questions/39129835/loading-sparkr-data-frame-in-hive) – Arun Gunalan May 04 '17 at 12:44

0 Answers0