WeiZhong94 commented on a change in pull request #10086: [FLINK-14584][python]
Support complex data types in Python user-defined functions
URL: https://github.com/apache/flink/pull/10086#discussion_r353047775
##########
File path: flink-python/pyflink/fn_execution/coder_impl.py
##########
@@ -140,6 +236,23 @@ def decode_from_stream(self, in_stream, nested):
return in_stream.read_bigendian_double()
+class DecimalCoderImpl(StreamCoderImpl):
+
+ def __init__(self, precision, scale):
+ decimal.getcontext().prec = precision
Review comment:
Maybe we should hold a individual context object here and replace current
context at the beginning of encode/decode and restore users' context at the end
of encode/decode?
----------------------------------------------------------------
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