Giter Site home page Giter Site logo

Add prefix matching expression about iceberg HOT 5 CLOSED

netflix avatar netflix commented on May 30, 2024
Add prefix matching expression

from iceberg.

Comments (5)

Liorba avatar Liorba commented on May 30, 2024

@rdblue can please give a bit more context on this issue?
is this prefix matching on partition transformation?
or is it new kind of Expression?

from iceberg.

Liorba avatar Liorba commented on May 30, 2024

working on this!

from iceberg.

Liorba avatar Liorba commented on May 30, 2024

@rdblue I tried to implement the startWith expression and I struggle with the fact that there is not place in the code I can assume that I'm working with strings.
all other Operation implementation at least in BoundExpressionVisitor, seem to rely on the comparator function implemented in types. which imply order.
startsWith should have to know that the literal and field types are both strings and use implantation other than compare.
if I do it like this the code will not compile, how do you suggest i'll add this?

from iceberg.

rdblue avatar rdblue commented on May 30, 2024

I'd start with adding a new factory method in Expressions that accepts a String. That will create an unbound predicate with a String literal, so you know at least that type. An unbound predicate may still be invalid.

Binding is the process of looking up the column in a schema to validate that it is there and then updating the expression to work with that column's type. For other predicates, the literal is coerced to the correct type in UnboundPredicate#bind by calling the literal's to method and passing in the column type. But in this case, you'd update bind to handle the startsWith expression and validate that both the column and the literal are types supported by the predicate. The bound predicate that is created by bind guarantees that types are coherent and that operations can be performed on those types.

To implement the startsWith predicate in an evaluator, you'd add it to the bound expression visitor and add eval implementations. Those implementations will operate on the guarantees from the binding process.

You should also implement at least inclusive projection in the transforms, but I can help you with that when you're close to that problem.

from iceberg.

rdblue avatar rdblue commented on May 30, 2024

I've moved this issue to apache/iceberg#31. Please continue discussion there. Thanks!

from iceberg.

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.