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

Huang Xingbo resolved FLINK-28176.
----------------------------------
    Resolution: Fixed

Merged into master via fa67c3b7072fb8d80d05e10b1703cff5700fcb39

> test_es_sink_dynamic failed in jdk11
> ------------------------------------
>
>                 Key: FLINK-28176
>                 URL: https://issues.apache.org/jira/browse/FLINK-28176
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Python
>    Affects Versions: 1.16.0
>            Reporter: Huang Xingbo
>            Assignee: Huang Xingbo
>            Priority: Critical
>              Labels: pull-request-available, test-stability
>             Fix For: 1.16.0
>
>
> {code:java}
> 2022-06-21T03:01:35.4707985Z Jun 21 03:01:35 _________________ 
> FlinkElasticsearch7Test.test_es_sink_dynamic _________________
> 2022-06-21T03:01:35.4709206Z Jun 21 03:01:35 
> 2022-06-21T03:01:35.4710708Z Jun 21 03:01:35 self = 
> <pyflink.datastream.tests.test_connectors.FlinkElasticsearch7Test 
> testMethod=test_es_sink_dynamic>
> 2022-06-21T03:01:35.4711754Z Jun 21 03:01:35 
> 2022-06-21T03:01:35.4712481Z Jun 21 03:01:35     def 
> test_es_sink_dynamic(self):
> 2022-06-21T03:01:35.4715653Z Jun 21 03:01:35         ds = 
> self.env.from_collection(
> 2022-06-21T03:01:35.4718082Z Jun 21 03:01:35             [{'name': 'ada', 
> 'id': '1'}, {'name': 'luna', 'id': '2'}],
> 2022-06-21T03:01:35.4719972Z Jun 21 03:01:35             
> type_info=Types.MAP(Types.STRING(), Types.STRING()))
> 2022-06-21T03:01:35.4721209Z Jun 21 03:01:35     
> 2022-06-21T03:01:35.4722120Z Jun 21 03:01:35 >       es_dynamic_index_sink = 
> Elasticsearch7SinkBuilder() \
> 2022-06-21T03:01:35.4723876Z Jun 21 03:01:35             
> .set_emitter(ElasticsearchEmitter.dynamic_index('name', 'id')) \
> 2022-06-21T03:01:35.4725448Z Jun 21 03:01:35             
> .set_hosts(['localhost:9200']) \
> 2022-06-21T03:01:35.4726419Z Jun 21 03:01:35             .build()
> 2022-06-21T03:01:35.4727430Z Jun 21 03:01:35 
> 2022-06-21T03:01:35.4877335Z Jun 21 03:01:35 
> pyflink/datastream/tests/test_connectors.py:132: 
> 2022-06-21T03:01:35.4882723Z Jun 21 03:01:35 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> 2022-06-21T03:01:35.4884972Z Jun 21 03:01:35 
> pyflink/datastream/connectors/elasticsearch.py:130: in set_hosts
> 2022-06-21T03:01:35.4886124Z Jun 21 03:01:35     j_http_hosts_array = 
> to_jarray(JHttpHost, j_http_hosts_list)
> 2022-06-21T03:01:35.4887527Z Jun 21 03:01:35 pyflink/util/java_utils.py:37: 
> in to_jarray
> 2022-06-21T03:01:35.4888600Z Jun 21 03:01:35     j_arr[i] = arr[i]
> 2022-06-21T03:01:35.4890812Z Jun 21 03:01:35 
> .tox/py39-cython/lib/python3.9/site-packages/py4j/java_collections.py:238: in 
> __setitem__
> 2022-06-21T03:01:35.4892201Z Jun 21 03:01:35     return self.__set_item(key, 
> value)
> 2022-06-21T03:01:35.4893842Z Jun 21 03:01:35 
> .tox/py39-cython/lib/python3.9/site-packages/py4j/java_collections.py:221: in 
> __set_item
> 2022-06-21T03:01:35.4895153Z Jun 21 03:01:35     return 
> get_return_value(answer, self._gateway_client)
> 2022-06-21T03:01:35.4896282Z Jun 21 03:01:35 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> 2022-06-21T03:01:35.4897191Z Jun 21 03:01:35 
> 2022-06-21T03:01:35.4900656Z Jun 21 03:01:35 answer = 
> 'zsorg.apache.flink.api.python.shaded.py4j.Py4JException: Cannot convert 
> org.apache.flink.elasticsearch7.shaded.org.ap...haded.py4j.GatewayConnection.run(GatewayConnection.java:238)\\n\tat
>  java.base/java.lang.Thread.run(Thread.java:829)\\n'
> 2022-06-21T03:01:35.4903369Z Jun 21 03:01:35 gateway_client = 
> <py4j.java_gateway.GatewayClient object at 0x7f7dd5b8b580>
> 2022-06-21T03:01:35.4904543Z Jun 21 03:01:35 target_id = None, name = None
> 2022-06-21T03:01:35.4905404Z Jun 21 03:01:35 
> 2022-06-21T03:01:35.4906381Z Jun 21 03:01:35     def get_return_value(answer, 
> gateway_client, target_id=None, name=None):
> 2022-06-21T03:01:35.4908583Z Jun 21 03:01:35         """Converts an answer 
> received from the Java gateway into a Python object.
> 2022-06-21T03:01:35.4909687Z Jun 21 03:01:35     
> 2022-06-21T03:01:35.4910838Z Jun 21 03:01:35         For example, string 
> representation of integers are converted to Python
> 2022-06-21T03:01:35.4912061Z Jun 21 03:01:35         integer, string 
> representation of objects are converted to JavaObject
> 2022-06-21T03:01:35.4913137Z Jun 21 03:01:35         instances, etc.
> 2022-06-21T03:01:35.4913921Z Jun 21 03:01:35     
> 2022-06-21T03:01:35.4914859Z Jun 21 03:01:35         :param answer: the 
> string returned by the Java gateway
> 2022-06-21T03:01:35.4916648Z Jun 21 03:01:35         :param gateway_client: 
> the gateway client used to communicate with the Java
> 2022-06-21T03:01:35.4918294Z Jun 21 03:01:35             Gateway. Only 
> necessary if the answer is a reference (e.g., object,
> 2022-06-21T03:01:35.4919591Z Jun 21 03:01:35             list, map)
> 2022-06-21T03:01:35.4920758Z Jun 21 03:01:35         :param target_id: the 
> name of the object from which the answer comes from
> 2022-06-21T03:01:35.4921963Z Jun 21 03:01:35             (e.g., *object1* in 
> `object1.hello()`). Optional.
> 2022-06-21T03:01:35.4923122Z Jun 21 03:01:35         :param name: the name of 
> the member from which the answer comes from
> 2022-06-21T03:01:35.4924246Z Jun 21 03:01:35             (e.g., *hello* in 
> `object1.hello()`). Optional.
> 2022-06-21T03:01:35.4925140Z Jun 21 03:01:35         """
> 2022-06-21T03:01:35.4925981Z Jun 21 03:01:35         if is_error(answer)[0]:
> 2022-06-21T03:01:35.4926846Z Jun 21 03:01:35             if len(answer) > 1:
> 2022-06-21T03:01:35.4927828Z Jun 21 03:01:35                 type = answer[1]
> 2022-06-21T03:01:35.4928784Z Jun 21 03:01:35                 value = 
> OUTPUT_CONVERTER[type](answer[2:], gateway_client)
> 2022-06-21T03:01:35.4929792Z Jun 21 03:01:35                 if answer[1] == 
> REFERENCE_TYPE:
> 2022-06-21T03:01:35.4930858Z Jun 21 03:01:35                     raise 
> Py4JJavaError(
> 2022-06-21T03:01:35.4931806Z Jun 21 03:01:35                         "An 
> error occurred while calling {0}{1}{2}.\n".
> 2022-06-21T03:01:35.4932792Z Jun 21 03:01:35                         
> format(target_id, ".", name), value)
> 2022-06-21T03:01:35.4933346Z Jun 21 03:01:35                 else:
> 2022-06-21T03:01:35.4933841Z Jun 21 03:01:35 >                   raise 
> Py4JError(
> 2022-06-21T03:01:35.4934829Z Jun 21 03:01:35                         "An 
> error occurred while calling {0}{1}{2}. Trace:\n{3}\n".
> 2022-06-21T03:01:35.4935466Z Jun 21 03:01:35                         
> format(target_id, ".", name, value))
> 2022-06-21T03:01:35.4936110Z Jun 21 03:01:35 E                   
> py4j.protocol.Py4JError: An error occurred while calling None.None. Trace:
> 2022-06-21T03:01:35.4937114Z Jun 21 03:01:35 E                   
> org.apache.flink.api.python.shaded.py4j.Py4JException: Cannot convert 
> org.apache.flink.elasticsearch7.shaded.org.apache.http.HttpHost to 
> org.apache.flink.elasticsearch7.shaded.org.apache.http.HttpHost
> 2022-06-21T03:01:35.4938983Z Jun 21 03:01:35 E                        at 
> org.apache.flink.api.python.shaded.py4j.commands.ArrayCommand.convertArgument(ArrayCommand.java:166)
> 2022-06-21T03:01:35.4940139Z Jun 21 03:01:35 E                        at 
> org.apache.flink.api.python.shaded.py4j.commands.ArrayCommand.setArray(ArrayCommand.java:144)
> 2022-06-21T03:01:35.4941251Z Jun 21 03:01:35 E                        at 
> org.apache.flink.api.python.shaded.py4j.commands.ArrayCommand.execute(ArrayCommand.java:97)
> 2022-06-21T03:01:35.4942313Z Jun 21 03:01:35 E                        at 
> org.apache.flink.api.python.shaded.py4j.GatewayConnection.run(GatewayConnection.java:238)
> 2022-06-21T03:01:35.4943334Z Jun 21 03:01:35 E                        at 
> java.base/java.lang.Thread.run(Thread.java:829)
> 2022-06-21T03:01:35.4943905Z Jun 21 03:01:35 
> 2022-06-21T03:01:35.4945225Z Jun 21 03:01:35 
> .tox/py39-cython/lib/python3.9/site-packages/py4j/protocol.py:330: Py4JError
> {code}
> https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=36979&view=logs&j=e92ecf6d-e207-5a42-7ff7-528ff0c5b259&t=40fc352e-9b4c-5fd8-363f-628f24b01ec2



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to