gpt4 book ai didi

java - 为什么 Apache Orc RecordReader.searchArgument() 没有成功?

转载 作者:搜寻专家 更新时间:2023-11-01 03:31:09 25 4
gpt4 key购买 nike

读的时候设置的谓词被下推了,但是从打印结果看好像不行,都打印出来了,这不是我想要的

我引用了下面的解决方法,没有解决方法 enter link description here为什么?

谢谢!

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();
}
}
}

最佳答案

搜索参数 filters只有文件、条纹、行组。它不会过滤行组中的行。

关于java - 为什么 Apache Orc RecordReader.searchArgument() 没有成功?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54248299/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com