1fanwang commented on code in PR #29297:
URL: https://github.com/apache/flink/pull/29297#discussion_r4552881411
##########
flink-python/pyflink/table/types.py:
##########
@@ -2348,25 +2351,33 @@ def to_arrow_type(data_type: DataType, *,
allow_nested=False):
else:
return pa.timestamp('ns')
elif isinstance(data_type, MapType):
- key_type = to_arrow_type(data_type.key_type, allow_nested=allow_nested)
- value_type = to_arrow_type(data_type.value_type,
allow_nested=allow_nested)
+ key_type = to_arrow_type(data_type.key_type, allow_nested=allow_nested,
+ allow_nested_rows=allow_nested_rows)
+ value_type = to_arrow_type(data_type.value_type,
allow_nested=allow_nested,
+ allow_nested_rows=allow_nested_rows)
# PyArrow 5 only accepts data types and always makes map values
nullable.
if hasattr(pa.MapType, 'item_field'):
value_type = pa.field("value", value_type,
nullable=data_type.value_type._nullable)
return pa.map_(key_type, value_type)
elif isinstance(data_type, ArrayType):
Review Comment:
Done in
https://github.com/apache/flink/commit/66c237224a02dd575ddb2d10b74a3bc23a8651a4.
Maps with zoned timestamps are now rejected like array elements and row
fields. This also rejects plain map columns, which master accepted. Should it
apply only to maps inside nested rows?
##########
flink-python/pyflink/table/tests/test_pandas_conversion.py:
##########
@@ -17,16 +17,47 @@
################################################################################
import datetime
import decimal
+import unittest
from pandas.testing import assert_frame_equal
from pyflink.common import Row
+from pyflink.table import EnvironmentSettings, TableEnvironment
from pyflink.table.types import DataTypes
from pyflink.testing import source_sink_utils
from pyflink.testing.test_case_utils import PyFlinkBatchTableTestCase, \
PyFlinkStreamTableTestCase
+class NestedPandasConversionTests(unittest.TestCase):
Review Comment:
Done in
https://github.com/apache/flink/commit/54f1ef5e28bfa2446c2374cbfc6576ec4dc7a193.
The cases now run in the batch and stream test classes, and the nested types
test that failed Azure now expects rows.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]