datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

Add example for writing a `FileFormat`

Open alamb opened this issue 1 year ago • 4 comments

Is your feature request related to a problem or challenge?

Now that @devinjdangelo has added better support for user defined file formats (see https://github.com/apache/datafusion/pull/11060)

We have an example of a custom table provider: https://datafusion.apache.org/library-user-guide/custom-table-providers.html and example

It would be great to have an example of creating a file format

Such an example would make sure the APIs added in this PR can be used for the end to end case, as well as obviously made it easier for others to discover and use this feature

Describe the solution you'd like

Add an example in https://github.com/apache/datafusion/tree/main/datafusion-examples that does:

  1. Creates a new file format (something basic like use CSV / ROT13)
  2. reads / writes data using that format

Describe alternatives you've considered

No response

Additional context

No response

alamb avatar Jun 23 '24 14:06 alamb

take

tshauck avatar Jun 23 '24 18:06 tshauck

I'll take this as I want to try it out. I do this for one of my libraries via the parser plus user defined nodes, so I want to see what this looks like as an alternative.

tshauck avatar Jun 23 '24 18:06 tshauck

I'll take this as I want to try it out. I do this for one of my libraries via the parser plus user defined nodes, so I want to see what this looks like as an alternative.

Thanks @tshauck -- note https://github.com/apache/datafusion/pull/11060 isn't merged yet, so you may have to start the example against that branch rather than main

alamb avatar Jun 23 '24 18:06 alamb

https://github.com/apache/datafusion/pull/11060 is now merged 🎉

alamb avatar Jun 28 '24 00:06 alamb