Skip to content

Conversation

@bkietz
Copy link
Member

@bkietz bkietz commented Jul 8, 2020

Enable casting from Scalar DictionaryScalar, which allows InsertImplicitCasts to convert non-dict scalars embedded in filter expressions.

@bkietz bkietz requested a review from jorisvandenbossche July 8, 2020 18:52
@github-actions
Copy link

github-actions bot commented Jul 8, 2020

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the C++ changes: you basically enabled casting to DictionaryScalar? (so that implicit casts in the dataset filter expression works?)

The enabled behaviour certainly looks good!

@bkietz
Copy link
Member Author

bkietz commented Jul 8, 2020

@jorisvandenbossche precisely

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but can you add tests on the C++ side?

@bkietz bkietz force-pushed the 9345-compare-with-dict-scalar branch from a103849 to 54a2a67 Compare July 9, 2020 20:44
@bkietz
Copy link
Member Author

bkietz commented Jul 9, 2020

@pitrou done, PTAL

}

TEST(TestDictionaryScalar, Basics) {
auto CheckIndexType = [&](const std::shared_ptr<DataType>& index_ty) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, this function was never called?

for (auto index_ty : all_dictionary_index_types()) {
auto ty = dictionary(index_ty, utf8());
auto dict = checked_pointer_cast<StringArray>(
ArrayFromJSON(utf8(), R"(["alpha", "beta", "gamma"])"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, perhaps test for null as well?

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if you'd like to quickly add a test for null, otherwise please merge :-)

@bkietz
Copy link
Member Author

bkietz commented Jul 10, 2020

The null case doesn't hit the new code here, so I think I'll merge now and add more tests in follow up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants