Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify TableFunctionSplitProcessor interface #17032

Merged
merged 7 commits into from
Apr 20, 2023

Conversation

findepi
Copy link
Member

@findepi findepi commented Apr 14, 2023

The TableFunctionSplitProcessor is used for one split only and then
new instance of TableFunctionSplitProcessor is created.

Provide the split directly to
TableFunctionProcessorProvider.getSplitProcessor and do not provide it
to TableFunctionProcessor.process. This removes conditionality of
argument presence in the process method and so makes things simpler.

Copy link
Member

@homar homar left a comment

Choose a reason for hiding this comment

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

I hate the idea of another rebase but this looks valid

@findepi findepi force-pushed the findepi/refac-leaf-tf branch 2 times, most recently from 21e38d8 to cbb1418 Compare April 14, 2023 11:05
@@ -32,7 +33,7 @@ default TableFunctionDataProcessor getDataProcessor(ConnectorTableFunctionHandle
* This method returns a {@code TableFunctionSplitProcessor}. All the necessary information collected during analysis is available
* in the form of {@link ConnectorTableFunctionHandle}. It is called once per each split processed by the table function.
*/
default TableFunctionSplitProcessor getSplitProcessor(ConnectorSession session, ConnectorTableFunctionHandle handle)
default TableFunctionSplitProcessor getSplitProcessor(ConnectorSession session, ConnectorTableFunctionHandle handle, ConnectorSplit split)
Copy link
Member Author

Choose a reason for hiding this comment

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

To me we could also return ConnectorPageSource here. If so, this would be a follow-up after this is agreed with @kasiafi @martint .

* @return {@link TableFunctionProcessorState} including the processor's state and optionally a portion of result.
* After the returned state is {@code FINISHED}, the method will not be called again for the split currently being processed
* and may be called with a new split.
Copy link
Member Author

Choose a reason for hiding this comment

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

This was actually incorrect, broken in #16955

@findepi findepi requested review from losipiuk, alexjo2144 and kasiafi and removed request for losipiuk, kasiafi and alexjo2144 April 18, 2023 06:43
@kasiafi
Copy link
Member

kasiafi commented Apr 18, 2023

The function sequence needs to be updated. Please rebase.

@findepi findepi force-pushed the findepi/refac-leaf-tf branch from cbb1418 to 3fe52ff Compare April 19, 2023 07:07
@findepi
Copy link
Member Author

findepi commented Apr 19, 2023

(just rebased)

@findepi findepi force-pushed the findepi/refac-leaf-tf branch from 3fe52ff to a8ae043 Compare April 19, 2023 07:24
@findepi
Copy link
Member Author

findepi commented Apr 19, 2023

(just rebased, for real this time, undoing some other stuff pushed together with rebase)

@findepi findepi force-pushed the findepi/refac-leaf-tf branch from a8ae043 to cb0d0e6 Compare April 19, 2023 07:44
@findepi
Copy link
Member Author

findepi commented Apr 19, 2023

AC

@findepi findepi force-pushed the findepi/refac-leaf-tf branch from cb0d0e6 to 305adfa Compare April 19, 2023 20:57
findepi added 3 commits April 20, 2023 15:08
All table functions processing interfaces are experimental (for example
`TableFunctionProcessorProvider`).
findepi added 4 commits April 20, 2023 15:08
`ArrayList` should not be used for cases where we remove elements from
the list start.
The `TableFunctionSplitProcessor` is used for one split only and then
new instance of `TableFunctionSplitProcessor` is created.

Provide the split directly to
`TableFunctionProcessorProvider.getSplitProcessor` and do not provide it
to `TableFunctionProcessor.process`. This removes conditionality of
argument presence in the `process` method and so makes things simpler.
@findepi findepi force-pushed the findepi/refac-leaf-tf branch from 305adfa to f2ab11c Compare April 20, 2023 13:08
@findepi findepi merged commit c8d07f1 into trinodb:master Apr 20, 2023
@findepi findepi deleted the findepi/refac-leaf-tf branch April 20, 2023 19:12
@github-actions github-actions bot added this to the 415 milestone Apr 20, 2023
@colebow colebow added the no-release-notes This pull request does not require release notes entry label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed no-release-notes This pull request does not require release notes entry
Development

Successfully merging this pull request may close these issues.

4 participants