Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Unable to skip column using JSONPropertyOrder #136

Open
shankyty opened this issue Nov 5, 2016 · 4 comments
Open

Unable to skip column using JSONPropertyOrder #136

shankyty opened this issue Nov 5, 2016 · 4 comments

Comments

@shankyty
Copy link

shankyty commented Nov 5, 2016

Unable to skip column in csv using JSONPropertyOrder
My use case is to load few speicfic columns, also needs to skip most of the columns

@cowtowncoder
Copy link
Member

I don't understand: skip? How would @JSONPropertyOrder help? CSV is positional so you must specify all columns the precede ones you need; there's no way around that.

You can, if that helps, just bind rows as String[] (or List<String>), and then extract positions you care about.

@shankyty
Copy link
Author

But I can specific column number using @JsonProperty("6") something like
this for csv then I do not have create schema separately before calling
mapper.read

On Thu, Nov 10, 2016, 12:21 AM Tatu Saloranta [email protected]
wrote:

I don't understand: skip? How would @JSONPropertyOrder help? CSV is
positional so you must specify all columns the precede ones you need;
there's no way around that.

You can, if that helps, just bind rows as String[](or List<String), and
then extract positions you care about.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#136 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE5wUryTcjcJ9durtou0zALHrPwLTrHnks5q8hYVgaJpZM4KqRRC
.

@cowtowncoder
Copy link
Member

@shankyty No. Properties are specified by name with that notation, and having JSON property name like "6" is completely legal (even if unlikely).

However, there is index:

@JsonProperty(index=6)

which could conceivably allow doing this. So... perhaps something like this could be done, theoretically speaking, if anyone wanted to work on this.

I could modify the title, or create a new issue, for this idea.

@shankyty
Copy link
Author

Reply I can work on this since I need it and I think it would cleaner
approach for me too.

On Thu, Nov 10, 2016, 9:19 AM Tatu Saloranta [email protected]
wrote:

@shankyty https://github.com/shankyty No. Properties are specified by
name with that notation, and having JSON property name like "6" is
completely legal (even if unlikely).

However, there is index:

@JsonProperty(index=6)

which could conceivably allow doing this. So... perhaps something like
this could be done, theoretically speaking, if anyone wanted to work on
this.

I could modify the title, or create a new issue, for this idea.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#136 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE5wUvY6o8aPePXqbRVb1Asu3fiuBtiuks5q8pQvgaJpZM4KqRRC
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants