spark写orc格式文件
发表于:2025-12-03 作者:千家信息网编辑
千家信息网最后更新 2025年12月03日,在hive中建表格式存储格式为orccreate table user(id int,name string) stored as orc;spark写文件 val jsons = "hdfs:
千家信息网最后更新 2025年12月03日spark写orc格式文件
在hive中建表格式存储格式为orc
create table user(id int,name string) stored as orc;
spark写文件
val jsons = "hdfs://localhost:9000/test/artist_orc.json" val people = sc.textFile(jsons) val schemaString = "id name" val schema = StructType(schemaString.split(" ").map(fieldName => {if(fieldName == "name") StructField(fieldName, StringType, true) else StructField(fieldName, IntegerType, true)})) val rowRDD = people.map(line=>{ JSONObject.fromObject(line) }).map(p => Row(new Integer(p.get("id").toString), p.get("name"))) val hiveContext = new org.apache.spark.sql.hive.HiveContext(sc) val peopleSchemaRDD = hiveContext.createDataFrame(rowRDD, schema) peopleSchemaRDD.write.format("orc").save("hdfs://localhost:9000/user/xb/warehouse/artist_orc/adf")
格式
文件
存储
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
null数据库中代表什么
网络技术三级有什么用
如何打开阿里云服务器
网络安全宣传周少先队
数据库怎么自动关闭
互联网创新科技公司
长宁区网络技术服务费用是多少
个人代码管理服务器
.net缓存服务器
apache服务器的配置
kuka机器人软件开发
互联网科技公司一般经营买啥设备
服务器上的文件下载到本地
凤娱网络技术有限公司
网络安全态势与创新
geo公共数据库
网络技术方面需要考证吗
blued连接服务器超时
疫情网络技术应用
nc服务器软件用的
ps4孤岛惊魂6连接服务器
ava数据库快吗
开展网络安全周活动方案
t440服务器raid
网络技术是幸福
服务器如何建网站
大学网络技术
北京农行软件开发属于总行吗
饥荒联机版服务器搭建好友卡顿
网络安全宣传周校园通讯稿