Comments (3)
@talnicolas can you post a stacktrace?
We represent optional Avro fields like that (union with null & null as defval) as optional fields in Connect. If I were to make an educated guess, this seems like the bug in SchemaProjector
.
diff --git a/connect/api/src/main/java/org/apache/kafka/connect/data/SchemaProjector.java b/connect/api/src/main/java/org/apache/kafka/connect/data/SchemaProjector.java
index ad0caf8..2cfd384 100644
--- a/connect/api/src/main/java/org/apache/kafka/connect/data/SchemaProjector.java
+++ b/connect/api/src/main/java/org/apache/kafka/connect/data/SchemaProjector.java
@@ -111,7 +111,7 @@ public class SchemaProjector {
} catch (SchemaProjectorException e) {
throw new SchemaProjectorException("Error projecting " + sourceField.name(), e);
}
- } else {
+ } else if (!targetField.schema().isOptional()) {
Object targetDefault;
if (targetField.schema().defaultValue() != null) {
targetDefault = targetField.schema().defaultValue();
UPDATE: created https://issues.apache.org/jira/browse/KAFKA-4173 for this
from kafka-connect-hdfs.
@shikhar Yes this is exactly the faulty line, we were wondering if it was the intended behaviour or if it was really a bug. Thanks for creating the JIRA ticket, I will follow that.
The stacktrace just to confirm:
ERROR Task some-sink-connector-1 threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerSinkTask) java.lang.RuntimeException: org.apache.kafka.connect.errors.SchemaProjectorException: Cannot project Schema{com.some.class:STRUCT} to Schema{com.some.class:STRUCT} at io.confluent.connect.hdfs.TopicPartitionWriter.write(TopicPartitionWriter.java:292) at io.confluent.connect.hdfs.DataWriter.write(DataWriter.java:234) at io.confluent.connect.hdfs.HdfsSinkTask.put(HdfsSinkTask.java:91) at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:370) at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:227) at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:170) at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:142) at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:140) at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:175) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.kafka.connect.errors.SchemaProjectorException: Cannot project Schema{com.some.class:STRUCT} to Schema{com.some.class:STRUCT} at org.apache.kafka.connect.data.SchemaProjector.projectStruct(SchemaProjector.java:119) at org.apache.kafka.connect.data.SchemaProjector.projectRequiredSchema(SchemaProjector.java:92) at org.apache.kafka.connect.data.SchemaProjector.project(SchemaProjector.java:72) at io.confluent.connect.hdfs.schema.SchemaUtils.project(SchemaUtils.java:66) at io.confluent.connect.hdfs.TopicPartitionWriter.write(TopicPartitionWriter.java:263) ... 13 more
from kafka-connect-hdfs.
Great, thanks, closing this as it's a framework issue
from kafka-connect-hdfs.
Related Issues (20)
- Issue in a Kerberized environment a day after renew ticket HOT 2
- Explain limitation listed in the documentation HOT 3
- using wrong user/keytab while there are multiple hdfs-sink connections HOT 1
- template file isn't committed and uploaded to storage when using AvroFormat
- java.util.ConcurrentModificationException during task rebalancing HOT 1
- log4j update schedule HOT 1
- Hive table does not match column names present in the parquet data
- Exception when reading Decimal types written by connector
- Hive Merge Feature
- Incremental Co-operative Rebalancing Support for HDFS Connector
- Error after install and unistall connect-transforms
- Adding Hive partition threw unexpected error
- HDFS2 connect compatibility with HDFS3 server
- CVE-2021-34538 HIGH vulnerability HOT 2
- Task is being killed and will not recover until manually restarted
- Allow to limit retry write errors by timeout
- Kafka Issue while running on docker and adding new connector HOT 1
- can't build because repo conjars is down
- multiple keytab kerberos issue HOT 1
- OzoneFileSystem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kafka-connect-hdfs.