Code Monkey home page Code Monkey logo

Comments (4)

mjakubowski84 avatar mjakubowski84 commented on July 20, 2024 1

Hi @isharamet ,

It looks like a bug. There is a Github issue created to replace the custom in predicate with one recently introduced to Parquet: #272.

from parquet4s.

mjakubowski84 avatar mjakubowski84 commented on July 20, 2024 1

Fix to be released in 2.11.0

from parquet4s.

isharamet avatar isharamet commented on July 20, 2024

And I believe the error is in inverseCanDrop method of InPredicate:

  override def inverseCanDrop(statistics: Statistics[T]): Boolean = {
    val compare   = statistics.getComparator.compare(_, _)
    val min       = statistics.getMin
    val max       = statistics.getMax
    val isInRange = (value: T) => compare(value, min) >= 0 && compare(value, max) <= 0
    values.exists(isInRange)
  }

While it works for canDrop, in not in scenario it'll drop all the blocks with values from the set, even if blocks might contain other values. So, for example from my original post all values will be stored in a single block (min = 1, max = 5), so this block will be skipped.

from parquet4s.

SergWh avatar SergWh commented on July 20, 2024

Hi @isharamet,

We faced this bug too and ended up implementing our own NinPredicate similar to https://github.com/mjakubowski84/parquet4s/blob/master/core/src/main/scala/com/github/mjakubowski84/parquet4s/Filter.scala#L323 with both canDrop and inverseCanDrop returning false. I don't see an option to utilize this "drop whole block if values not in range" logic, since for nin it should rather be "accept whole block if values not in range".

This can be a temporary solution until nin predicate is supported.

from parquet4s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.