shuiqiangchen commented on a change in pull request #13029: URL: https://github.com/apache/flink/pull/13029#discussion_r463451278
########## File path: flink-python/pyflink/common/typeinfo.py ########## @@ -0,0 +1,576 @@ +################################################################################ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +from abc import ABC, abstractmethod + +from py4j.java_gateway import JavaClass, JavaObject + +from pyflink.java_gateway import get_gateway + + +class TypeInformation(ABC): + """ + TypeInformation is the core class of Flink's type system. FLink requires a type information + for all types that are used as input or return type of a user function. This type information + class acts as the tool to generate serializers and comparators, and to perform semantic checks + such as whether the fields that are used as join/grouping keys actually existt. + + The type information also bridges between the programming languages object model and a logical + flat schema. It maps fields from the types to columns (fields) in a flat schema. Not all fields + from a type are mapped to a separate fields in the flat schema and often, entire types are + mapped to one field.. It is important to notice that the schema must hold for all instances of a + type. For that reason, elements in lists and arrays are not assigned to individual fields, but + the lists and arrays are considered to be one field in total, to account for different lengths + in the arrays. + a) Basic types are indivisible and are considered as a single field. + b) Arrays and collections are one field. + c) Tuples and case classes represent as many fields as the class has fields. Review comment: Yes, I will remove it. ---------------------------------------------------------------- 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]
