[
https://issues.apache.org/jira/browse/SPARK-32938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hyukjin Kwon resolved SPARK-32938.
----------------------------------
Resolution: Invalid
It's just you're trying to cast binary to long type which isn't allowed. You'd
have to convert first to something else like string.
> Spark can not cast long value from Kafka
> ----------------------------------------
>
> Key: SPARK-32938
> URL: https://issues.apache.org/jira/browse/SPARK-32938
> Project: Spark
> Issue Type: Bug
> Components: Java API, SQL, Structured Streaming
> Affects Versions: 3.0.0
> Environment: Debian 10 (Buster), AMD64
> Spark 3.0.0
> Kafka 2.5.0
> spark-sql-kafka-0-10_2.12
> Reporter: Matthias Seiler
> Priority: Major
>
> Spark seems to be unable to cast the key (or value) part from Kafka to a
> _{color:#172b4d}long{color}_ value and throws
> {code:java}
> org.apache.spark.sql.AnalysisException: cannot resolve 'CAST(`key` AS
> BIGINT)' due to data type mismatch: cannot cast binary to bigint;;{code}
>
> {color:#172b4d}See this repo for further investigation:{color}
> [https://github.com/maseiler/spark-kafka-
> casting-bug|https://github.com/maseiler/spark-kafka- casting-bug]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]