Java 为什么Apache Orc RecordReader.searchArgument()没有成功?
读取时设置的谓词被向下推,但从打印结果看似乎不起作用,打印结果已全部打印出来,这不是我想要的 我指的是以下解决方案,但没有解决方案 为什么? 谢谢大家!Java 为什么Apache Orc RecordReader.searchArgument()没有成功?,java,Java,读取时设置的谓词被向下推,但从打印结果看似乎不起作用,打印结果已全部打印出来,这不是我想要的 我指的是以下解决方案,但没有解决方案 为什么? 谢谢大家! public class parseOrcFile { public static void main(String[] args) { Configuration conf = new Configuration(); try { String file_path = "/ap
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();
}
}
}
公共类文件{
公共静态void main(字符串[]args){
Configuration conf=新配置();
试一试{
字符串文件_path=“/apps/hive/warehouse/orc_stu/test.orc”;
ReaderOptions ReaderOptions=OrcFile.ReaderOptions(conf);
路径路径=新路径(文件路径);
Reader Reader=OrcFile.createReader(路径,readerOptions);
List sis=reader.getStripes();
TypeDescription模式=reader.getSchema();
SearchArgument sarg=SearchArgumentFactory.newBuilder()
.startNot()
.lessThan(“id”,PredicateLeaf.Type.LONG,100L)
(完)
.startAnd()
.lessThan(“id”,谓词ELEAF.Type.LONG,200L)
(完)
.build();
Reader.Options opt=Reader.Options()
.schema(schema)
.include(新布尔值[]{true,true,true,true})
.searchArgument(sarg,新字符串[]{null,“id”,“name”,“age”,“sex”});
RecordReader read\u row\u opt=reader.rows(opt);
VectorizedRowBatch rowBatch=schema.createRowBatch();
while(读取行选择下一批(行批)){
System.out.println(rowBatch.toString());
}
}捕获(IOE异常){
e、 printStackTrace();
}
}
}
仅搜索参数文件、条纹、行组。它不会筛选行组中包含的行