Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Mar 19, 2024

Which issue does this PR close?

Related to #9586

Rationale for this change

While working on #9679 I realized that the amount of coverage for ARRAYs other than the (very extensive) coverage for functions was pretty sparse

What changes are included in this PR?

Add a new array_query.slt file that has basic query patterns for filtering, aggregation, grouping and ordering

Are these changes tested?

it is only tests

Are there any user-facing changes?

no

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Mar 19, 2024
# Filtering
###########

query error DataFusion error: Arrow error: Invalid argument error: Invalid comparison operation: List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\) == List\(Field \{ name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: \{\} \}\)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was actually surprised I couldn't write a basic filter for ARRAYs -- do you know if this is tracked by any ticket @jayzhan211 ?

Copy link
Contributor

@jayzhan211 jayzhan211 Mar 29, 2024

Choose a reason for hiding this comment

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

No, there is no filed issue with filter. We can open one, it seems like an interesting feature. I think we can utilize logical plan::filter.

Copy link
Contributor

@jayzhan211 jayzhan211 Mar 29, 2024

Choose a reason for hiding this comment

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

No, there is no filed issue with filter. We can open one, it seems like an interesting feature. I think we can utilize logical plan::filter.

I was confused with array_filter, maybe we just need to support array types for filterExec 🤔

# Aggregates
###########

query error Internal error: Min/Max accumulator not implemented for type List
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should probably make this at least a nicer error ("Not supported" rather than "internal error")

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree

@alamb
Copy link
Contributor Author

alamb commented Mar 29, 2024

@jayzhan211 I wonder if you would have a few minutes to review this PR sometime?

Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

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

👍

@jayzhan211 jayzhan211 merged commit 230a6b4 into apache:main Mar 29, 2024
Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Apr 1, 2024
* Add tests for filtering, grouping, aggregation of ARRAYs

* Update output to correct results
@alamb alamb deleted the alamb/array_agg_tests branch April 1, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants