V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  liprais  ›  全部回复第 142 页 / 共 163 页
回复总数  3258
1 ... 138  139  140  141  142  143  144  145  146  147 ... 163  
2016-03-18 11:02:26 +08:00
回复了 anonymoustian 创建的主题 Hadoop Spark 读取 Hive 数据库的代码谁能提供一份, Java 实现的
@anonymoustian
"Configuration of Hive is done by placing your hive-site.xml, core-site.xml (for security configuration), hdfs-site.xml (for HDFS configuration) file in conf/. Please note when running the query on a YARN cluster (cluster mode), the datanucleus jars under the lib directory and hive-site.xml under conf/ directory need to be available on the driver and all executors launched by the YARN cluster. The convenient way to do this is adding them through the --jars option and --file option of the spark-submit command."
把上述三个文件(hive-site.xml,core-site.xml,hdfs-site.xml)拷到 spark 的 conf 下面就行了
然后读写的时候代码如下

// sc is an existing JavaSparkContext.
HiveContext sqlContext = new org.apache.spark.sql.hive.HiveContext(sc.sc);


// Queries are expressed in HiveQL.
sqlContext.sql("select * from YOUR_HIVE_TABLE_NAME").collect();
2016-03-18 09:26:16 +08:00
回复了 anonymoustian 创建的主题 Hadoop Spark 读取 Hive 数据库的代码谁能提供一份, Java 实现的
@anonymoustian

SparkConf conf = new SparkConf().setAppName("JavaRFormulaExample");
JavaSparkContext jsc = new JavaSparkContext(conf);
HiveContext hiveContext = new HiveContext(jsc);
2016-03-18 09:00:15 +08:00
回复了 anonymoustian 创建的主题 Hadoop Spark 读取 Hive 数据库的代码谁能提供一份, Java 实现的
文档看了么?
把 hive 的配置拷到 conf 下面,再 new 一个 hivecontext 就可以了
2016-03-17 16:50:59 +08:00
回复了 shawnall 创建的主题 云计算 腾讯云 · 升级公告— Linux 系统盘容量升级&弹性扩容公告
从去年八月骂到现在,终于上线了
2016-03-17 11:16:03 +08:00
回复了 garyzhang 创建的主题 问与答 大公司究竟比小公司强在哪里?
大公司你做的产品可能出错了客户就要上门来砍死你,感受一下
小公司出错了可能你都不知道
2016-03-15 14:03:54 +08:00
回复了 madfrog1984 创建的主题 Hadoop 15 台规模的 hadoop 集群的机器的硬件配置选择问题
aws 搞定收工
2016-03-08 10:19:05 +08:00
回复了 Dagundelv 创建的主题 云计算 牛逼的腾讯云
腾讯云的技术实力简直呵呵
2016-02-01 17:19:31 +08:00
回复了 whahuzhihao 创建的主题 问与答 为什么一个 10M 的纯文本 html 可以瞬间加载完毕?
开了压缩了吧
2016-01-28 20:17:17 +08:00
回复了 Gem 创建的主题 问与答 jetbrains 家什么时候会有优惠活动?
一个月不到十美元还要怎样
2016-01-27 17:54:53 +08:00
回复了 jmc891205 创建的主题 职场话题 现在觉得带实习生也是很难的
@ljk 我觉得独当一面这个词还是不要乱用为妙
2016-01-06 09:06:26 +08:00
回复了 ranzige 创建的主题 服务器 求推荐一个靠谱的日志分析工具
2016-01-05 15:34:31 +08:00
回复了 cszhiyue 创建的主题 Uber uber 的人民优步+比较坑
给司机打一星就好了
jruby
lz 听说过 drm 么
不跟猪打架不是常识么....
2015-11-10 12:42:46 +08:00
回复了 loveltyoic 创建的主题 云计算 国内有没有可以部署 Spark 的云服务?
百度
2015-11-04 23:32:28 +08:00
回复了 Crossin 创建的主题 职场话题 应届生的 offer 选择:携程和 intel,求建议
无脑选 intel 啊
1 ... 138  139  140  141  142  143  144  145  146  147 ... 163  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1227 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 65ms · UTC 18:01 · PVG 02:01 · LAX 11:01 · JFK 14:01
Developed with CodeLauncher
♥ Do have faith in what you're doing.