You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/07/04 07:23:00 UTC
[jira] [Updated] (FLINK-32327) Python Kafka connector runs into strange NullPointerException
[ https://issues.apache.org/jira/browse/FLINK-32327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated FLINK-32327:
-----------------------------------
Labels: pull-request-available (was: )
> Python Kafka connector runs into strange NullPointerException
> -------------------------------------------------------------
>
> Key: FLINK-32327
> URL: https://issues.apache.org/jira/browse/FLINK-32327
> Project: Flink
> Issue Type: Sub-task
> Components: API / Python
> Reporter: Chesnay Schepler
> Priority: Major
> Labels: pull-request-available
>
> The following error occurs when running the python kafka tests:
> (this uses a slightly modified version of the code, but the error also happens without it)
> {code:python}
> def set_record_serializer(self, record_serializer: 'KafkaRecordSerializationSchema') \
> -> 'KafkaSinkBuilder':
> """
> Sets the :class:`KafkaRecordSerializationSchema` that transforms incoming records to kafka
> producer records.
>
> :param record_serializer: The :class:`KafkaRecordSerializationSchema`.
> """
> # NOTE: If topic selector is a generated first-column selector, do extra preprocessing
> j_topic_selector = get_field_value(record_serializer._j_serialization_schema,
> 'topicSelector')
>
> caching_name_suffix = 'KafkaRecordSerializationSchemaBuilder.CachingTopicSelector'
> if j_topic_selector.getClass().getCanonicalName().endswith(caching_name_suffix):
> class_name = get_field_value(j_topic_selector, 'topicSelector')\
> .getClass().getCanonicalName()
> > if class_name.startswith('com.sun.proxy') or class_name.startswith('jdk.proxy'):
> E AttributeError: 'NoneType' object has no attribute 'startswith'
> {code}
> My assumption is that {{getCanonicalName}} returns {{null}} for some objects, and this set of objects may have increased in Java 17. I tried adding a null check, but that caused other tests to fail.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)