Skip to content

ARROW-13973: [C++] Add a SelectKSinkNode - #11274

Closed
aocsa wants to merge 4 commits into
apache:masterfrom
aocsa:aocsa/ARROW-13973
Closed

aocsa wants to merge 4 commits into
apache:masterfrom
aocsa:aocsa/ARROW-13973

Conversation

@aocsa

@aocsa aocsa commented Sep 29, 2021 •

Copy link
Copy Markdown
Contributor

Hook up the SelectK kernel in ARROW-1565 to the query engine as another type of sink node.

Also mentioned here:
https://issues.apache.org/jira/browse/ARROW-12763

@github-actions

Copy link
Copy Markdown

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Looks good, just some questions on how we should organize the sink nodes.

Comment thread cpp/src/arrow/compute/exec/select_k.cc Resolved
Comment thread cpp/src/arrow/compute/exec/plan_test.cc Resolved
Comment thread cpp/src/arrow/compute/exec/sink_node.cc Resolved
Comment thread cpp/src/arrow/compute/exec/sink_node.cc Resolved

@westonpace westonpace left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a good starting point. Although, if I'm using "head", "limit", or a size-limited sink node of any kind, I think my motivation would be concern that I have a lot of data and I would expect the node to limit that.

For example, a top-k implementation could periodically (when batches_ has some configurable # of rows) run through and discard data. The way it is written now it would still require me to buffer the entire dataset in memory (and/or spillover).

Admittedly this would be more CPU efficient but I think that can be a reasonable tradeoff in some cases. Do we have a JIRA for a more RAM-efficient top-k sink?

@lidavidm

lidavidm commented Oct 1, 2021

Copy link
Copy Markdown
Member

There is a JIRA (can't find it right now) for a streaming/scalar aggregate version of the kernel, yes. I think this suffices to get things out the door, though, so to speak. We don't really have an out-of-core story in general right now.

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@aocsa

aocsa commented Oct 1, 2021

Copy link
Copy Markdown
Contributor Author

I think this is a good starting point. Although, if I'm using "head", "limit", or a size-limited sink node of any kind, I think my motivation would be concern that I have a lot of data and I would expect the node to limit that.

For example, a top-k implementation could periodically (when batches_ has some configurable # of rows) run through and discard data. The way it is written now it would still require me to buffer the entire dataset in memory (and/or spillover).

Admittedly this would be more CPU efficient but I think that can be a reasonable tradeoff in some cases. Do we have a JIRA for a more RAM-efficient top-k sink?

L

I think this is a good starting point. Although, if I'm using "head", "limit", or a size-limited sink node of any kind, I think my motivation would be concern that I have a lot of data and I would expect the node to limit that.

For example, a top-k implementation could periodically (when batches_ has some configurable # of rows) run through and discard data. The way it is written now it would still require me to buffer the entire dataset in memory (and/or spillover).

Admittedly this would be more CPU efficient but I think that can be a reasonable tradeoff in some cases. Do we have a JIRA for a more RAM-efficient top-k sink?

Yes it's here: https://issues.apache.org/jira/browse/ARROW-14202

ViniciusSouzaRoque pushed a commit to s1mbi0se/arrow that referenced this pull request Oct 20, 2021
Hook up the SelectK kernel in ARROW-1565 to the query engine as another type of sink node.

Also mentioned here:
https://issues.apache.org/jira/browse/ARROW-12763

Closes apache#11274 from aocsa/aocsa/ARROW-13973

Authored-by: Alexander <aocsa.cs@gmail.com>
Signed-off-by: Neal Richardson <neal.p.richardson@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants