tzulitai commented on a change in pull request #7655: [FLINK-11539] Add
TypeSerializerSnapshot for TraversableSerializer
URL: https://github.com/apache/flink/pull/7655#discussion_r255410039
##########
File path:
flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeInformationGen.scala
##########
@@ -238,10 +243,24 @@ private[flink] trait TypeInformationGen[C <: Context] {
val elementTpe = $elementTypeInfo
new TraversableTypeInfo($collectionClass, elementTpe) {
def createSerializer(executionConfig: ExecutionConfig) = {
+ val elementSerializer = elementTpe.createSerializer(executionConfig)
+
+ //
-------------------------------------------------------------------------------------
+ // NOTE:
+ // the following anonymous class is needed here, and should not be
removed
+ // (although appears to be unused) since it is required for
backwards compatibility
+ // with Flink versions pre 1.8, that were using Java deserialization.
+ //
-------------------------------------------------------------------------------------
+ val unused = new TraversableSerializer[${desc.tpe},
${desc.elem.tpe}](
+ elementSerializer,
+ $cbfStringLiteral) {
+
+ override def legacyCbfCode = $cbfStringLiteral
+ }
+
new TraversableSerializer[${desc.tpe}, ${desc.elem.tpe}](
- elementTpe.createSerializer(executionConfig)) {
Review comment:
As mentioned above, to be on the safe side, leave this creation as is, and
create a new element serializer for the actual returned traversable serializer?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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