on-internet
← Community

reading and writing from hive tables with spark after aggregation

Stack Overflow ·

We have a hive warehouse, and wanted to use spark for various tasks (mainly classification). At times write the results back as a hive table. For example, we wrote the following python function to find the total sum of original_table column two, grouped by original_table column one. The function works, but we are worried that it is inefficient, particularly the maps to convert to key-value pairs, and dictionary versions. Functions combiner, mergeValue, mergeCombiner are defined elsewhere, but work fine. from pyspark import HiveContext rdd = HiveContext(sc).sql('from original_table select *') #

Comments

Sign in or sign up to comment and upvote.

No comments yet.