Repository navigation
Conversation
adc5551 to
7fc23dd
Compare
|
R centos-7 (gcc 4.8) compilation fails: https://github.com/apache/arrow/pull/8894/checks?check_run_id=1572105784#step:9:513 |
pitrou
left a comment
There was a problem hiding this comment.
Ok, I think I've reviewed the C++ side of this.
| }; | ||
| RETURN_NOT_OK(CanonicalizeAndFoldConstants()); | ||
|
|
||
| for (const auto& guarantee : conjunction_members) { |
There was a problem hiding this comment.
Instead of looping on conjunction members, have you tried to match all members at once in the post-visit callback in DirectComparisonSimplification?
There was a problem hiding this comment.
What would be the advantage?
There was a problem hiding this comment.
Visiting the tree only once may be cheaper, though that would have to be measured.
| RETURN_NOT_OK(ExtractKnownFieldValuesImpl(&conjunction_members, &known_values)); | ||
|
|
||
| ARROW_ASSIGN_OR_RAISE(expr, | ||
| ReplaceFieldsWithKnownValues(known_values, std::move(expr))); |
There was a problem hiding this comment.
Is this useful, given that DirectComparisonSimplification should catch these cases as well?
There was a problem hiding this comment.
It should indeed catch those cases. My plan was to extract a function
Result<map<FieldRef, {
Datum min,
Datum max,
bool nullable,
bool include_min,
bool include_max
}>> ExtractKnownRanges(guarantee);
for independent testing (which wouldn't handle the equality case), but I haven't done so yet. In any case this shouldn't represent a perf penalty since the conjunction_members which correspond to those equality conditions are extracted before running DirectComparisonSimplification
There was a problem hiding this comment.
Another reason for the separation is DirectComparisonSimplification requires that the simplified expression is also a comparison. This will not catch cases such as is_in(a, [1,2,3]) where a == 4 so we wouldn't be able to skip that partition
9718255 to
9a00cef
Compare
There was a problem hiding this comment.
Doesn't necessarily need to happen in this PR, but: I personally don't find this a very user-friendly error message with "FieldRef.Name" in it (I think the previous was more readable)
There was a problem hiding this comment.
I can certainly change the error message, but I'd like to wait for a follow up
|
@github-actions crossbow submit test-conda-python-3.7-dask-latest test-conda-python-3.7-pandas-master test-conda-python-3.7-pandas-latest |
|
Ah, the bot doesn't work at the moment I suppose. I ran the dask/parquet tests locally, and they are passing. I also ran my tax-dataset dask notebook with some queries using this branch, but apparently there is a bug in the latest version of dask to read those (something I need to investigate and report/fix in dask). But that also happens with released pyarrow 2.0.0, so not caused by this PR. |
@kszucs fixed this today (it was blocked by INFRA) so it should work if you rebase. |
|
The python failure looks legit: Seems that the |
|
Revision: 9a00cef5c82a032107d36b7fd47d1ec8a14703b0 Submitted crossbow builds: ursa-labs/crossbow @ actions-824
|
|
(the failing test-conda-python-3.7-pandas-latest is the same serialization test failure as mentioned above) |
|
(I reviewed the minimal python changes, which look good, and looked at part of the C++ dataset changes, but no need to wait on further review from my side) |
pitrou
left a comment
There was a problem hiding this comment.
I didn't review everything again.
There was a problem hiding this comment.
Can you put this inside the anonymous namespace above?
There was a problem hiding this comment.
Also, nit but I don't understand why this is in cast.{h,cc}. I would expect to only find the cast functions here. A new scalar_nested.{h,cc} would seem a more logical place.
There was a problem hiding this comment.
(I'm also curious why it's called "project". It sounds rather imprecise, though it may be the conventional term for this operation?)
There was a problem hiding this comment.
"project" is the conventional term. I'll move it to a separate header/source.
There was a problem hiding this comment.
Add comment as for AddSimpleCast above?
There was a problem hiding this comment.
actually, AddSimpleCast is no longer referenced anywhere so I'll just rename this
There was a problem hiding this comment.
For the record, is there a fast path when conversion.second == 1? Otherwise, perhaps create a JIRA for it.
There was a problem hiding this comment.
There is a fast path for this.
There was a problem hiding this comment.
By the way, perhaps tag these APIs experimental, so that we can change them without warning?
There was a problem hiding this comment.
Is a comment at the top of the file insufficient?
| /// \param[in] by A StructArray whose columns will be used as grouping criteria. | ||
| /// \return A StructArray mapping unique rows (in field "values", represented as a | ||
| /// StructArray with the same fields as `by`) to lists of indices where | ||
| /// that row appears (in field "groupings"). |
There was a problem hiding this comment.
Perhaps make this more explicit in the docstring then?
| encoded = column.mutable_array(); | ||
|
|
||
| auto indices = | ||
| std::make_shared<Int32Array>(encoded->length, std::move(encoded->buffers[1])); |
There was a problem hiding this comment.
Similarly, std::move seems wrong if the column is already dictionary-encoded.
| *fused_indices = checked_pointer_cast<Int32Array>(new_fused_indices.make_array()); | ||
|
|
||
| // XXX should probably cap this at 2**15 or so | ||
| ARROW_CHECK(!internal::MultiplyWithOverflow(size_, dictionary_size, &size_)); |
1ca0dc6 to
b14a456
Compare
commented
Jan 6, 2021
|
non Apache CI: https://github.com/bkietz/arrow/runs/1659121616 |
commented
Jan 7, 2021
Although it's clearly related, I personally still find it a bit strange name for this specific (user exposed) function (but I am certainly not very familiar with the different contexts where "project" gets used, eg in Python/pandas this term is basically never used). |
commented
Jan 7, 2021
|
The |
This PR replaces the
Expressionclass hierarchy with a simpler discriminated union of:This reduces the overhead of supporting new compute functions in dataset filters: execution and validation against a schema are already implemented and tested in
compute::. Only serialization and equality comparison need to be manually wired up, and only if the function requires nontrivial function options.TODO replace projection with expressions as well. The
structfunction is provided to replaceRecordBatchProjector, invocable withcallas with any other compute function: