question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Caching conflict when creating CSV schemas with different views for the same POJO

See original GitHub issue

#195 added csv schema creation with views. Using the same CsvMapper with the same POJO for different views leads to unexpected results as the used view is not considered when a schema is loaded from cache as it was registered for the pojoType. Obviously, the used view should be part of the key for the cache maps _untypedSchemas and _typedSchemas.

https://github.com/FasterXML/jackson-dataformats-text/blob/1202fec8d6243da77435fc723162d738acb1c8ad/csv/src/main/java/com/fasterxml/jackson/dataformat/csv/CsvMapper.java#L425-L433

Edit: A workaround is quite simple. In order to clear the cache, just use csvmapper.copy().schemaForWithView(...) instead of csvmapper.schemaForWithView(...).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cowtowncodercommented, Dec 16, 2021

2.14: keeping caching simple for 2.13 patch just in case.

There isn’t a lot about contributing, just this:

https://github.com/FasterXML/jackson/blob/master/CONTRIBUTING.md

0reactions
mrpiggicommented, Dec 16, 2021

Sure, I can try to find some time. Should I create a PR based on 2.13 or 2.14? Are there any contribution guide lines?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parse CSV with extra columns which are not defined in POJO ...
I believe the issue is that you need to specify a specific Schema. For the Student class defined thusly: @JsonIgnoreProperties(ignoreUnknown ...
Read more >
Apache Beam Programming Guide
Apache Beam Programming Guide. The Beam Programming Guide is intended for Beam users who want to use the Beam SDKs to create data...
Read more >
Spring Batch - Reference Documentation
Parallel processing of many different batch runs or jobs at the same time. ... These views are used by each instance of the...
Read more >
Solved: When adding a .csv file as a standalone table to a...
If the CSV is used in a join to another table or layer, there is some additional schema caching that prevents the schema...
Read more >
User Guide Volume 1: Teiid Designer Red Hat JBoss Data ...
Business metadata details other information about the data, such as keywords related ... views, procedures) that conflict with the objects being imported, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found