Proposal: Rename FileSinkExec
#9940
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
-
Update (4/13/2024)
This was renamed to
DataSinkExec
in #10065TL;DR:
I'm proposing to rename
FileSinkExec
toInsertExec
orDataSinkExec
(or another suitable name).Why
In the middle of implementing
TableProvider.insert_into
for a TableProvider to write to a remote query engine, I searched the DataFusion codebase for examples of how this was done. I ran acrossFileSinkExec
but 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
DataSink
trait - which looked perfect for my use-case - and eventually realized thatFileSinkExec
was 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
FileSinkExec
isn'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 implementDataSink
for the actual insert and useFileSinkExec
in the TableProvider - and it all works.Thoughts on renaming it to
InsertExec
orDataSinkExec
?Beta Was this translation helpful? Give feedback.
All reactions