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

Allow use of "value decorators" (like [ and ] for arrays) for reading CsvSchema columns #442

Closed
cowtowncoder opened this issue Nov 23, 2023 · 1 comment
Assignees
Labels
2.18 Fix or feature targeted at 2.18 release csv

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Nov 23, 2023

Currently it is possible to decode Array values from columns, by specifying Array Element separator (default being ";"). But there is quite a bit of data that uses outer "wrappers", f.ex commonly we might have:

id,title,"[1.0, 0.4, 16.98]"

wherein brackets are used around the sequence of values.

We should allow supporting such notation by addition to CsvSchema. Could start by allowing use of start/end String; no need to get fancy at first (but could conceivably support regexps if need be, i.e. take java.util.regex.Pattern start/end markers).

NOTE: this issue is specifically for READING such decorated values: different issue (#495) filed for WRITING.

@cowtowncoder cowtowncoder added csv 2.17 Fix or feature targeted at 2.17 release labels Nov 23, 2023
cowtowncoder added a commit that referenced this issue Dec 2, 2023
@cowtowncoder cowtowncoder self-assigned this Dec 2, 2023
@cowtowncoder cowtowncoder changed the title Allow configuring Array value "wrappers" (like [ and ]) for CsvSchema Allow configuring "value wrappers" (like [ and ] for arrays) for CsvSchema columns Aug 24, 2024
@cowtowncoder
Copy link
Member Author

Changing definition so that CsvValueDecorators can be registered for actual columns.
And in fact initially that is how it must be done, assigning to specific columns.
After this works, may consider per-schema Array decorators.

@cowtowncoder cowtowncoder changed the title Allow configuring "value wrappers" (like [ and ] for arrays) for CsvSchema columns Allow configuring "value decorators" (like [ and ] for arrays) for CsvSchema columns Aug 24, 2024
@cowtowncoder cowtowncoder changed the title Allow configuring "value decorators" (like [ and ] for arrays) for CsvSchema columns Allow use of "value decorators" (like [ and ] for arrays) for reading CsvSchema columns Aug 26, 2024
@cowtowncoder cowtowncoder added 2.18 Fix or feature targeted at 2.18 release and removed 2.17 Fix or feature targeted at 2.17 release labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.18 Fix or feature targeted at 2.18 release csv
Projects
None yet
Development

No branches or pull requests

1 participant