Open allisonport-db opened 3 months ago
FYI , I am working on this right now per recommendation from https://github.com/delta-io/delta/pull/2830#issuecomment-2032311536 Will submit a PR in a few days Thanks :)
Hi @vkorukanti I added lazy evaluation support for comparator expressions https://github.com/delta-io/delta/pull/2853 I have some question on the behavior of null comparison, if you have time can you take a look Thank you
Feature request
Which Delta project/connector is this regarding?
Overview
The expression handler should short-circuit on logical operators. This requires making all expression evaluation lazy since evaluation needs to be on a per-row basis.
First step: Convert all comparators (e.g. =, > etc) to be lazy. Rough idea on how to do that is:
Create a comparator based on the data type of inputs. Both inputs are expected to have the same inputs.
if (dataType instance BooleanType) { return new VectorComparator() { int compare(ColumnVector left, ColumnVector right, int rowId) { boolean leftResult = left.getBoolean(rowId); boolean rightResult = right.getBoolean(rowId); return Boolean.compare(leftResult, rightResult); } } else if (dataType instance of IntegerType) { .... } .. more types... }
Return a
ColumnVector
that wraps the above created comparator and returns result based on the comparator operator typeWillingness to contribute
The Delta Lake Community encourages new feature contributions. Would you or another member of your organization be willing to contribute an implementation of this feature?