stone@1024 2019-01-17 17:55 采纳率: 0%
浏览 880

java解析orc格式文件设置谓词下推,过滤条件没有生效

java解析orc格式文件谓词下推

使用Java解析orc文件,设置谓词下推,并没有生效

SearchArgument sarg = SearchArgumentFactory
    .newBuilder(conf)
    .startAnd()
    .startNot()
    .lessThan("id", PredicateLeaf.Type.LONG, 100L)
    .end()
    .lessThan("id", PredicateLeaf.Type.LONG, 400L)
    .end()
    .build();
RecordReader rowIterator = reader
    .rows(reader.options()
    .range(0L, Long.MAX_VALUE)
    .include(new boolean[]{true, true, true, true, true})
    .searchArgument(sarg, new String[]{null, "id", "name", "age", "sex"}));

VectorizedRowBatch batch = reader.getSchema().createRowBatch();

while (rowIterator.nextBatch(batch)) {
    System.out.println(batch.toString())
}

但是从打印结果来看,不符合条件的数据也打印出来了,为什么?
谓词下推如何生效,百度google都试了,没有解决。求解谢谢!

0 stone_0 53 Y
.....

19 stone_19 50 X

20 stone_20 58 Y

21 stone_21 50 X

22 stone_22 55 Y

23 stone_23 58 X

24 stone_24 53 Y

25 stone_25 52 X

26 stone_26 57 Y

27 stone_27 58 X

28 stone_28 57 Y

29 stone_29 56 X

30 stone_30 50 Y

31 stone_31 55 X

32 stone_32 55 Y

33 stone_33 50 X

34 stone_34 57 Y

35 stone_35 52 X

36 stone_36 55 Y

....

999 stone_999 50 X

  • 写回答

1条回答 默认 最新

  • 铁头乔 2019-02-21 10:31
    关注

    https://stackoverflow.com/questions/44691416/why-is-apache-orc-recordreader-searchargument-not-filtering-correctly

    如果一个RowBatch可能有结果集,就把这个RowBatch全返回了,可能类似bloomfilter

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题