sunjincheng121 commented on a change in pull request #8420: 
[FLINK-12408][python] Allow to define the data types in Python
URL: https://github.com/apache/flink/pull/8420#discussion_r286751122
 
 

 ##########
 File path: flink-python/pyflink/table/types.py
 ##########
 @@ -16,171 +16,1811 @@
 # limitations under the License.
 
################################################################################
 
+import calendar
+import ctypes
+import datetime
+import decimal
 import sys
+import time
+from array import array
+from copy import copy
+from functools import reduce
+from threading import RLock
 
-if sys.version > '3':
-    xrange = range
+from pyflink.util.utils import to_jarray
+from pyflink.java_gateway import get_gateway
 
-__all__ = ['DataTypes']
+if sys.version >= '3':
+    long = int
+    basestring = unicode = str
+
+__all__ = ['DataTypes', 'UserDefinedType', 'Row']
 
 
 class DataType(object):
     """
     Base class for data types.
+
+    :param nullable: boolean, whether the type can be null (None) or not.
 
 Review comment:
   Could we add the  Python DOC same as JAVA, please 
[see](https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/DataType.java#L50):
  
   I think some of the descriptions in JAVA is very necessary, such as:
   ```
   DataType has two responsibilities: declaring a logical type and giving hints
   about the physical representation of data to the optimizer. While the 
logical type is mandatory,
    hints are optional but useful at the edges to other APIs
   ```
   Is that make sense to you?
   

----------------------------------------------------------------
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

Reply via email to