Proposal: Rename FileSinkExec
#9940
Closed
phillipleblanc
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
|
FileSinkExec is used internally to DataFusion as the physical plan for inserting to ListingTables and writing out files via COPY statements. Both write out files, hence the name FileSinkExec. I agree though that the plan can be used even more generally to sink to non file sources, so DataSinkExec could be a reasonable more general name. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Also potentially related is the discussion from @wiedld about supporting the file writer outside #9493 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Update (4/13/2024)
This was renamed to
DataSinkExecin #10065TL;DR:
I'm proposing to rename
FileSinkExectoInsertExecorDataSinkExec(or another suitable name).Why
In the middle of implementing
TableProvider.insert_intofor a TableProvider to write to a remote query engine, I searched the DataFusion codebase for examples of how this was done. I ran acrossFileSinkExecbut dismissed it, since I wasn't writing to a file and I figured it was specific to that.I ended up writing a custom Execution Plan that would perform the insert and return an Arrow record with the number of rows changed - but I felt that surely this was already done somewhere. I ended up finding the
DataSinktrait - which looked perfect for my use-case - and eventually realized thatFileSinkExecwas initially calledInsertExec- which I would have used from the beginning if it had been called that. (Renamed in #7283)As far as I can tell
FileSinkExecisn't specific to files - but I'm still new to the DataFusion codebase, so I might be missing some context. I reworked my implementation to implementDataSinkfor the actual insert and useFileSinkExecin the TableProvider - and it all works.Thoughts on renaming it to
InsertExecorDataSinkExec?Beta Was this translation helpful? Give feedback.
All reactions