[jira] [Created] (FLINK-21412) pyflink DataTypes.DECIMAL is not available

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-21412) pyflink DataTypes.DECIMAL is not available

Shang Yuanchun (Jira)
awayne created FLINK-21412:
------------------------------

             Summary: pyflink DataTypes.DECIMAL is not available
                 Key: FLINK-21412
                 URL: https://issues.apache.org/jira/browse/FLINK-21412
             Project: Flink
          Issue Type: Bug
          Components: API / Python
    Affects Versions: 1.12.1
         Environment: python 3.7.5

pyflink 1.12.1
            Reporter: awayne


when i use DataTypes.DECIMAL in udaf
File "/home/ubuntu/pyflenv/lib/python3.7/site-packages/pyflink/table/types.py", line 2025, in _to_java_data_type
 _to_java_data_type(data_type._element_type))
 File "/home/ubuntu/pyflenv/lib/python3.7/site-packages/pyflink/table/types.py", line 1964, in _to_java_data_type
 j_data_type = JDataTypes.Decimal(data_type.precision, data_type.scale)
 File "/home/ubuntu/pyflenv/lib/python3.7/site-packages/py4j/java_gateway.py", line 1516, in __getattr__
 "\{0}.\{1} does not exist in the JVM".format(self._fqn, name))
py4j.protocol.Py4JError: org.apache.flink.table.api.DataTypes.Decimal does not exist in the JVM

 

in pyflink\table\types.py

line 1963-1964

elif isinstance(data_type, DecimalType):
    j_data_type = JDataTypes.{color:#FF0000}Decimal{color}(data_type.precision, data_type.scale)

in java should be called "DECIMAL"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)