- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
create table n_data(MARKET string,CATEGORY string,D map<string,string>,monthid int,value DOUBLE)
STORED AS ORC
;
我将数据加载到其中(超过45000000行),查看hive仓库
结果表由5个文件组成,大小为10MB-20MB,但dfs.block.size设置为128MB,存储小文件不是最佳选择,因为它使用了整个 block !
如何设置 HIVE 将文件分割为 128 MB?
编辑插入查询:
insert into n_data
select tmp.market,tmp.category,d,adTable.monthid,tmp.factperiod[adTable.monthid] as fact
from (select market,category,d,factperiod,map_keys(factperiod) as month_arr from n_src where market is not null) as tmp
LATERAL VIEW explode(month_arr) adTable AS monthid
最佳答案
您必须为 hive 设置以下配置参数:
hive.merge.mapfiles = true
hive.merge.mapredfiles = true
hive.merge.tezfiles = true
hive.merge.smallfiles.avgsize = 16000000
我遇到了完全相同的问题,直到我发现 this source 。您可以尝试使用“set”命令在 hive session 中手动设置这些参数,如下所示:
set hive.merge.mapfiles=true;
set hive.merge.mapredfiles=true;
set hive.merge.tezfiles=true;
set hive.merge.smallfiles.avgsize=16000000;
如果您只是输入“set;”在配置单元 session 控制台中,您可以检查上述参数是否设置正确。测试后,我建议在 hive-site.xml 配置文件中或通过 Ambari 更改它们(如果您使用的是 Hortonworksdistribution)。干杯!
关于Hive 将 ORC 文件分割成小部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31317434/
我在 Hive 中有一个分区的 ORC 表。在用所有可能的分区加载表后,我得到了 HDFS - 多个 ORC 文件,即 HDFS 上的每个分区目录都有一个 ORC 文件。对于某些用例,我需要将每个分区
关于 SO 和网络的大多数问题/答案都讨论了使用 Hive 将一堆小的 ORC 文件组合成一个更大的文件,但是,我的 ORC 文件是按天分隔的日志文件,我需要将它们分开。我只想每天“汇总”ORC 文件
我正在对 Hive 可用的存储格式进行一些测试,并使用 Parquet 和 ORC 作为主要选项。我将 ORC 一次包含在默认压缩中,一次包含在 Snappy 中。 我读过许多文档,指出 Parque
我正在尝试使用上面提到的 orc 工具 jar 来转换 JSON 文件 https://orc.apache.org/docs/tools.html#java-orc-tools 我已将其导入到我的
我创建了一个存储为 ORC 的托管配置单元表,当加载 .txt 文件时它工作正常,但是我无法将 ORC 文件加载到该表中。与分隔符有什么关系吗?还是我错过了什么? 最佳答案 下面的代码对我有用,同时将
当我读取 orcfile 并将数据写入 orcfile 时,出现以下错误: expected org.apache.hadoop.hive.ql.io.orc.OrcStruct, received
在浏览了一个示例 ORC 文件后,我了解到 ORC 文件格式不存储任何列信息,实际上所有列名都会被替换为 _c0 到 _cn,在这种情况下如何为 ORC 实现适当的架构演变表? 最佳答案 ORC 格式
我在 HDFS 中有一些数据是使用 Sqoop 导入的。数据以 ORC 格式导入,压缩为 Snappy。 我正在尝试使用以下 DDL 语句在此数据之上创建一个表。但是,我收到以下错误。 FAILED:
我有一个程序,其输入应为 ORC 文件格式。 我希望能够检查提供的输入是否实际上是一个 ORC 文件。仅检查扩展名是不够的,因为用户可以省略扩展名。 例如,对于 Parquet,我们可以 check如
我目前正在实现对 HDFS 和 Hive 表的监控数据的 ETL (Talend)。 我现在面临重复的问题。更详细地说,如果我们需要使用相同的输入运行一个 ETL 作业 2 次,我们最终会在 Hive
create table n_data(MARKET string,CATEGORY string,D map,monthid int,value DOUBLE) STORED AS ORC
如何将文本文件加载到 Hive orc 外部表中? create table MyDB.TEST ( Col1 String, Col2 String, Col3 String, Col4 S
在 HDP 2.3 for Windows 中的 Apache Pig 交互式 shell 中工作,我在 /path/to/file 中有一个现有的 ORC 文件。如果我加载然后保存使用: a = L
假设我有一个像这样的 Hive 查询: CREATE TABLE student (key string, name string, course struct) STORED AS ORC; 由于
我可以更新单个列,但不能更新从另一个表引用的多个列。 我启用了所有 ACID 属性以支持配置单元 (1.2.1) 表更新。 我有两个表, 表 1: 架构: create table table1(em
我正在尝试使用 orc-core 编写 orc 文件稍后由 hive 读取。 正在写入的文件具有正确的行数,但列中没有内容。我可以看到,两者都试图在配置单元中使用选择查询读取文件,并且都使用 hive
我读过很多关于 ORC 文件格式在压缩和快速查询方面有多么出色的帖子,特别是与 Parquet 格式相比。我了解 ORC 如何跨行组拆分数据,将它们分割为列组,以及它如何使用元数据和内部统计信息来跳过
我有一个要求,我想将 5GB ORC 文件拆分为 5 个文件,每个文件大小为 1GB。ORC 文件是可拆分的。这是否意味着我们只能逐条分割文件?但我有要求根据大小拆分 orc 文件。例如,将 5GB
将 Hive 外部表从 RC 升级为 ORC 格式并在其上运行 MSCK REPAIR TABLE 时,当我从表中选择全部时,出现以下错误 - Failed with exception java.i
我是大数据和相关技术的新手,所以我不确定我们是否可以将数据附加到现有的 ORC 文件中。我正在使用 Java API 编写 ORC 文件当我关闭 Writer 时,我无法再次打开文件来写入新内容,基本
我是一名优秀的程序员,十分优秀!