java - 为什么 Apache Orc RecordReader.searchArgument() 没有成功?
问题描述
读的时候设置的谓词下推了,但是从打印结果看好像不行,全部打印出来了,不是我想要的
我参考了下面的解决方案,但是没有解决办法 在这里输入链接描述为什么?
谢谢你!
public class parseOrcFile {
public static void main(String[] args) {
Configuration conf = new Configuration();
try {
String file_path = "/apps/hive/warehouse/orc_stu/test.orc";
ReaderOptions readerOptions = OrcFile.readerOptions(conf);
Path path = new Path(file_path);
Reader reader = OrcFile.createReader(path, readerOptions);
List<StripeInformation> sis = reader.getStripes();
TypeDescription schema = reader.getSchema();
SearchArgument sarg = SearchArgumentFactory.newBuilder()
.startNot()
.lessThan("id", PredicateLeaf.Type.LONG, 100L)
.end()
.startAnd()
.lessThan("id", PredicateLeaf.Type.LONG, 200L)
.end()
.build();
Reader.Options opt = reader.options()
.schema(schema)
.include(new boolean[]{true, true, true, true, true})
.searchArgument(sarg, new String[]{null, "id", "name", "age", "sex"});
RecordReader read_row_opt = reader.rows(opt);
VectorizedRowBatch rowBatch = schema.createRowBatch();
while (read_row_opt.nextBatch(rowBatch)) {
System.out.println(rowBatch.toString());
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
解决方案
SearchArgument仅过滤文件、条带、行组。它不会过滤行组中的行。
推荐阅读
- php - Wordpress - 带有标题 HTML 的博客文章导出
- python - 筛选和冲浪的opencv contrib问题
- mysql - 如何在 DB Fiddle 上获得执行时间?
- php - 在 PHP 中匹配输入文本和输入文件
- google-app-engine - 将 appengine 1 的数据存储用于 appengine 2
- c# - 什么可能导致 ContinuationTaskFromResultTask`1[TAntecedentResult].InnerInvoke() 抛出 NullReferenceException?
- amazon-web-services - 提高缓存命中率 Cloudfront
- azure - Azure API 管理 OAuth2 配置 - 创建授权服务和 ClientID/Secret
- perl - 现在在 indent2tree 中禁止对标量进行实验性推送
- url - encodeURIComponent 与 URLSearchParams 的不同输出