wuchong commented on a change in pull request #9139:
[FLINK-13304][FLINK-13322][FLINK-13323][table-runtime-blink] Fix implementation
of getString and getBinary method in NestedRow, fix serializer restore in
BaseArray/Map serializer and add tests for complex data formats
URL: https://github.com/apache/flink/pull/9139#discussion_r305261402
##########
File path:
flink-core/src/test/java/org/apache/flink/api/common/typeutils/SerializerTestBase.java
##########
@@ -124,30 +124,8 @@ public void testSnapshotConfigurationAndReconfigure()
throws Exception {
final TypeSerializer<T> serializer = getSerializer();
final TypeSerializerSnapshot<T> configSnapshot =
serializer.snapshotConfiguration();
- byte[] serializedConfig;
- try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
-
TypeSerializerSnapshotSerializationUtil.writeSerializerSnapshot(
- new DataOutputViewStreamWrapper(out),
configSnapshot, serializer);
- serializedConfig = out.toByteArray();
- }
-
- TypeSerializerSnapshot<T> restoredConfig;
- try (ByteArrayInputStream in = new
ByteArrayInputStream(serializedConfig)) {
- restoredConfig =
TypeSerializerSnapshotSerializationUtil.readSerializerSnapshot(
- new DataInputViewStreamWrapper(in),
Thread.currentThread().getContextClassLoader(), getSerializer());
- }
-
- TypeSerializerSchemaCompatibility<T> strategy =
restoredConfig.resolveSchemaCompatibility(getSerializer());
- final TypeSerializer<T> restoreSerializer;
- if (strategy.isCompatibleAsIs()) {
- restoreSerializer = restoredConfig.restoreSerializer();
- }
- else if (strategy.isCompatibleWithReconfiguredSerializer()) {
- restoreSerializer =
strategy.getReconfiguredSerializer();
- }
- else {
- throw new AssertionError("Unable to restore serializer
with " + strategy);
- }
+ final TypeSerializer<T> restoreSerializer =
snapshotAndReconfigure(
Review comment:
Is this a bug of this class? Is there any way do not touch this file?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services