这是有效率的,数据框或RDD或hiveql? [英] Which is efficient, Dataframe or RDD or hiveql?

查看:112
本文介绍了这是有效率的,数据框或RDD或hiveql?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手到Apache的火花。

I am newbie to Apache Spark.

我的工作是读过两年的CSV文件,从中选择一些特定列,将其合并,汇总,并把结果写入到一个CSV文件。

My job is read two CSV files, select some specific columns from it, merge it, aggregate it and write the result into a single CSV file.

例如,

姓名,年龄,deparment_id

name,age,deparment_id

部门标识,deparment_name,位置

department_id,deparment_name,location

姓名,年龄,deparment_name

name,age,deparment_name

我加载这两个CSV到dataframes。
然后能够得到使用几种方法加入,选择,过滤数据框第三,在数据帧下降present

I am loading both the CSV into dataframes. And then able to get the third dataframe using several methods join,select,filter,drop present in dataframe

我也能够做到的使用几种RDD.map相同的()

I am also able to do the same using several RDD.map()

和我也能够做到通过执行hiveql使用HiveContext相同

And I am also able to do the same using executing hiveql using HiveContext

我想知道这是有效的方式,如果我的CSV文件,是巨大的,为什么?

I want to know which is the efficient way if my CSV files are huge and why?

推荐答案

这两个DataFrames和火花SQL查询所使用的催化剂引擎优化,所以我猜他们会产生类似的性能
(假设你正在使用的版本> = 1.3)

Both DataFrames and spark sql queries are optimized using the catalyst engine, so I would guess they will produce similar performance (assuming you are using version >= 1.3)

和两者都应该是比简单的操作RDD更好,因为RDDS,火花不具备对各类数据的任何知识,所以它不能做任何特殊的优化

And both should be better than simple RDD operations, because for RDDs, spark don't have any knowledge about the types of your data, so it can't do any special optimizations

这篇关于这是有效率的,数据框或RDD或hiveql?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆