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

Add support for nested fields in CSV by encoding them as JSON #54

Open
ttencate opened this issue Aug 19, 2024 · 0 comments · May be fixed by #55
Open

Add support for nested fields in CSV by encoding them as JSON #54

ttencate opened this issue Aug 19, 2024 · 0 comments · May be fixed by #55

Comments

@ttencate
Copy link

ttencate commented Aug 19, 2024

Great tool, glad I found it, because I almost started writing something like this myself!

One thing I ran into, though... nested types can't be exported to CSV.

Error: ArrowReadWriteError(CsvError("Nested type List(Field { name: \"item\", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) is not supported in CSV"))

Sometimes, we just don't care about the exact format, or don't even care about this particular column, and just want to load the dang thing into a spreadsheet. Encoding non-primitive column types as JSON helps to accomplish just that, and also happens to be non-ambiguous and therefore possibly even useful.

ttencate added a commit to ttencate/pqrs that referenced this issue Aug 19, 2024
These apply to both `cat` and `head` subcommands, and specify how to
handle nested fields if the output format is CSV (which does not support
nested fields). The default, `--nested-fields=error`, just exits with a
helpful error message.

This also changes the printing of errors escaping from the `main()`
function to use `Display`, rather than `Debug`, in order to make them
more user-friendly.

Fixes manojkarthick#54.
@ttencate ttencate linked a pull request Aug 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant