[FLINK-39458][table] Move Table type converters and serializers into new flink-table-type-utils module#27980
[FLINK-39458][table] Move Table type converters and serializers into new flink-table-type-utils module#27980autophagy wants to merge 2 commits intoapache:masterfrom
Conversation
3a4212b to
297a60c
Compare
twalthr
left a comment
There was a problem hiding this comment.
Thanks for the PR. Overall the changes make a lot of sense. We had multiple discussions in the past whether we want to move type conversion related classes into a separate module. Imho the PR moved more than I expected. Overall for the test harness we only need "the new type stack", so basically everything under DataStructureConverters. Not necessarily DataFormatConverters. Very special serializers such as SortedMapSerializer can stay in runtime module. Here is a list of stuff that I identified during the review, not necessarily complete:
- WindowKey, WindowKeySerializerTest.java can stay in runtime
- RawValueDataAsserter.java into table-common?
- LinkedListSerializerTest can stay in runtime
- DataFormatTestUtil.rowDataToString to test which uses it.
- SortedMapSerializer, SortedMapTypeInfo, PagedTypeSerializer into table-runtime
- TypeCheckUtils stay in runtime if possible?
- DataFormatConverters and transitively e.g. TimestampDataTypeInfo stay in runtime
- LegacyTimestampTypeInfo stays in runtime
| <version>${project.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> |
There was a problem hiding this comment.
make sure it is included in table-runtime and thus we won't need this dependency in all pom.xml files
|
@twalthr Thank you for the feedback! Yeah, it looks like I was a little overzealous in moving lots over, keeping things confined to the structure converters and the necessary serializers makes sense. One area where i've diverged from your suggestion is moving Moving |
…new flink-table-type-utils module
twalthr
left a comment
There was a problem hiding this comment.
Thanks for the update @autophagy. I still found 3 classes that we might not need to move as they are legacy classes:
AbstractMapTypeInfo
BigDecimalTypeInfo
StringDataTypeInfo
| <version>${project.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> |
…s into new flink-table-type-utils module
What is the purpose of the change
This PR extracts table api type utilities like data structure converters and serializers into a lightweight
flink-table-type-utilsmodule. This allows other modules to access the converters, serializers etc without pulling in heavy dependencies like runtime and planner.This also involved moving a few classes out from
flink-runtimetoflink-coreso that both runtime and the type-utils module can use them. They were implementations of interfaces already found inflink-core, so I felt that it would be okay to move them, as they weren't dependent on the runtime module at large. Still unsure if this is right, or whether they should exist in some new module.An alternative approach I tried was just moving the
DataConvertersand using a kind of strategy pattern for converters that relied on some of the serializers, but this felt too clunky, and the serializers were already in atype-utilssubdirectory, so felt appropriate to move.Brief change log
flink-table-type-utilsmoduleDataStructureConverter/DataStructureConvertersand their implementations into the new submoduleflink-table-runtime'stype-utilssubdirectory into the new submoduleAbstractPagedInputView,AbstractPagedOutputView,ListMemorySegmentSource,RandomAccessInputViewandRandomAccessOutputViewfromflink-runtimetoflink-coreto avoid circular dependencies (these are pure i/o classes and so didnt depend on the wider runtime module, and implement interfaces already defined inflink-core)Verifying this change
Does this pull request potentially affect one of the following parts:
flink-table-type-utilsmodule)@Public(Evolving): (no)Documentation