Skip to content

Add deserialization support for Table<R, C, V> #163

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

Merged
merged 8 commits into from
Nov 5, 2024

Conversation

Abhishekkr3003
Copy link
Contributor

Closes #1

@cowtowncoder
Copy link
Member

Excellent, thank you @Abhishekkr3003 ! I will need to review this in detail, but looks good so far.

One thing we will need (if not yet done -- only needed once) is CLA, from:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

and it's usually easiest to print, fill & sign, scan/photo, email to cla at fasterxml dot com.
This is only needed once, before the first contribution.

Once I have CLA & reviewed code can merge it.

Thank you again & looking forward to merging this!

@Abhishekkr3003
Copy link
Contributor Author

@cowtowncoder Thank you for sharing CLA. I have just signed and shared it.

@@ -258,9 +261,6 @@ public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type,
elementTypeDeserializer, elementDeserializer);
}

if (Table.class.isAssignableFrom(raw)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cowtowncoder, should we use MapLikeType/MapLikeDeserializer or not? What I found is if we keep it MapLikeType, then we have to use Type something like Map<R, Map<C, V>>, and then we'll have KeyDeserializer for RowKey and JsonDeserializer for ColumnValueMap, and then while deserializing the Table<R, C, V> we'll have to deserialize Map<C, V> first and then have to put each C, V in Table<R, C, V> for R, which is inefficient in my opinion. Contrarily, if we don't use MapLikeType and keep it JavaType (Using Bean Deserializer), we can deserialize directly to Table<R, C, V>.

What do you think about this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmh. Tough question. I think that:

  1. Type should be retained as MapLikeType (to help Jackson databind be somewhat aware of type's semantic)
  2. But! We do NOT need to use MapLikeDeserializer, if that is possible

If (2) can't be done for some reason (I may be overlooking something), I'm ok in change to make Tables not be considered "Map-like". This will add some work on (de)serialization handling, possibly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I have used MapLikeType without using any other MapLikeType deserialization arguments, as if we use elementDeserializer, then we might have to first deserialize to Map<C, V> and then have to put in Table<R,C,V>, since we cannot get C's deserializer and V's deserializer separately from JsonDeserializer<?> elementDeserializer of this API:

public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)

Well, this is from my limited knowledge of this codebase; please do correct me if I'm missing something here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good -- hoping to review this in near future, just having bit of overload with everything going on. But thank you again for this contribution!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update! I completely understand, and no worries at all. Take your time. I’m happy to contribute and look forward to any feedback whenever you’re able to review. Thanks again!

@cowtowncoder cowtowncoder added the cla-received Marker to denote that required CLA received label Oct 30, 2024
@cowtowncoder cowtowncoder changed the title (guava) Adds deserialization support for Table<R, C, V> Add deserialization support for Table<R, C, V> Nov 5, 2024
Copy link
Member

@cowtowncoder cowtowncoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cowtowncoder cowtowncoder merged commit a29cda6 into FasterXML:2.19 Nov 5, 2024
9 checks passed
@cowtowncoder
Copy link
Member

Ok, merging to master (3.0) was fun, but got it done.

Thank you very much @Abhishekkr3003 -- this is a great addition for Jackson 2.19!

@Abhishekkr3003
Copy link
Contributor Author

Thank you @cowtowncoder. It was a pleasure working on this!

@anuragagarwal561994
Copy link

@cowtowncoder when is this planned to be released?

@cowtowncoder
Copy link
Member

@anuragagarwal561994 "when 2.19.0 is ready". No specific date in mind, probably not before early March tho -- focusing most of work for completing first release candidate for 3.0.0 (to be done by end of February).

@anuragagarwal561994
Copy link

Hi @cowtowncoder any updates on the release of 2.19?

@cowtowncoder
Copy link
Member

@anuragagarwal561994 No. Probably sometime in April.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.19 cla-received Marker to denote that required CLA received guava
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add deserialization support for Table<R, C, V>
3 participants