You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dian Fu (Jira)" <ji...@apache.org> on 2020/12/19 02:33:00 UTC

[jira] [Closed] (FLINK-20666) Fix the deserialized Row losing the field_name information in PyFlink

     [ https://issues.apache.org/jira/browse/FLINK-20666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dian Fu closed FLINK-20666.
---------------------------
    Fix Version/s: 1.12.1
                   1.11.4
                   1.13.0
       Resolution: Fixed

Fixed in
- master via 2061b720f6995c0701df390dce767d1e2a9645b2
- release-1.12 via cd4d3f1bed19c5d3223f493a200922734e7f87d3
- release-1.11 via 3c0253936f2e6cf8d4fcb3d5b4c6050de2626d9f

> Fix the deserialized Row losing the field_name information in PyFlink
> ---------------------------------------------------------------------
>
>                 Key: FLINK-20666
>                 URL: https://issues.apache.org/jira/browse/FLINK-20666
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Python
>    Affects Versions: 1.12.0, 1.11.2
>            Reporter: Huang Xingbo
>            Assignee: Huang Xingbo
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.13.0, 1.11.4, 1.12.1
>
>
> Now, the deserialized Row loses the field_name information.
> {code:java}
> @udf(result_type=DataTypes.STRING())
> def get_string_element(my_list):
>     my_string = 'xxx'
>     for element in my_list:
>         if element.integer_element == 2:  # element lost the field_name information
>             my_string = element.string_element
>     return my_string
> t = t_env.from_elements(
>     [("1", [Row(3, "flink")]), ("3", [Row(2, "pyflink")]), ("2", [Row(2, "python")])],
>     DataTypes.ROW(
>         [DataTypes.FIELD("Key", DataTypes.STRING()),
>          DataTypes.FIELD("List_element",
>                          DataTypes.ARRAY(DataTypes.ROW(
>                              [DataTypes.FIELD("integer_element", DataTypes.INT()),
>                               DataTypes.FIELD("string_element", DataTypes.STRING())])))]))
> print(t.select(get_string_element(t.List_element)).to_pandas())
> {code}
> element lost the field_name information



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