Skip to content

Conversation

@umeshdangat
Copy link
Contributor

@umeshdangat umeshdangat commented Jun 7, 2024

There is a circular dependency between the DataFieldSerializer, DataTypeSerializer, and RowTypeSerializer classes. This circular dependency can lead to incomplete initialization of the serializers, causing a NullPointerException when you attempt to use them.

Here's a breakdown of the problem:

  1. DataFieldSerializer has a DataTypeSerializer instance.
  2. DataTypeSerializer has a RowTypeSerializer instance.
  3. RowTypeSerializer has a ListSerializer<DataField> instance, which in turn uses DataFieldSerializer.

This circular dependency can cause the serializers to be in an incomplete state when they are first accessed, leading to the NullPointerException.

Code below is enough to re-create this NPE

        RowType innerMostRowType = RowType.of(DataTypes.BIGINT());
        RowType outerRowType = RowType.of(
                DataTypes.ROW(DataTypes.FIELD("outerRow", innerMostRowType)));

        DataTypeSerializer serializer = new DataTypeSerializer();


        assertNotNull(RowTypeSerializer.INSTANCE, "RowTypeSerializer.INSTANCE is null");
        RowType copiedRow = (RowType) serializer.copy(outerRowType);

…ataFieldSerializer`, `DataTypeSerializer`, and `RowTypeSerializer` classes that causes NPE for certain RowTypes like nested row type
@github-actions
Copy link

github-actions bot commented Aug 7, 2024

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added Stale and removed Stale labels Aug 7, 2024
@github-actions
Copy link

github-actions bot commented Oct 7, 2024

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Oct 7, 2024
@github-actions
Copy link

github-actions bot commented Nov 7, 2024

This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request.

@github-actions github-actions bot closed this Nov 7, 2024
@yuxiqian
Copy link
Member

Could @leonardBang please reopen this?

@leonardBang leonardBang reopened this Nov 14, 2024
@umeshdangat
Copy link
Contributor Author

PR #3434 also has this change! Merging that should enable us to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants