Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid value: null used for required field: "A_NAME", schema type: STRING #109

Open
quyendqmz opened this issue Oct 28, 2021 · 2 comments

Comments

@quyendqmz
Copy link

When update a column in table, in-case table has other not null column not be updated => exception occurs.
For example: I update column AGE only.

create table A_TEST
(
ID NUMBER generated as identity
constraint A_TEST_PK
primary key,
A_NAME VARCHAR2(50) not null,
AGE NUMBER
)

Log miner enable min and primary key level
Bellow is error:

Error during poll on topic TEST_DB.TEST_SCHEMA.A_TEST SQL :update "TEST_SCHEMA"."A_TEST" set "AGE" = 17 where "ID" = 1 and "AGE" = 10 (com.ecer.kafka.connect.oracle.OracleSourceTask:297)

org.apache.kafka.connect.errors.DataException: Invalid value: Invalid value: null used for required field: "A_NAME", schema type: STRING
at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:220)
at org.apache.kafka.connect.data.Struct.validate(Struct.java:233)
at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:250)
at org.apache.kafka.connect.data.Struct.put(Struct.java:216)
at org.apache.kafka.connect.data.Struct.put(Struct.java:203)
at com.ecer.kafka.connect.oracle.OracleSourceTask.setValueV2(OracleSourceTask.java:330)
at com.ecer.kafka.connect.oracle.OracleSourceTask.poll(OracleSourceTask.java:279)
at org.apache.kafka.connect.runtime.WorkerSourceTask.poll(WorkerSourceTask.java:291)
at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:248)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:186)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:241)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

@cyrusmaster
Copy link

+1 我遇到过相同问题 不清楚什么原因 要不然你@一下作者

@pawankukreja01
Copy link

it seems that the error message you are seeing is related to the com.ecer.kafka.connect.oracle.OracleSourceTask class.

One possible reason for this error could be that the A_NAME column in your table is defined as not null and is not being updated along with the AGE column . This could be causing the DataException to be thrown with the message “Invalid value: null used for required field: ‘A_NAME’

To resolve this issue, you may want to ensure that all columns defined as not null in your table are being updated along with the AGE column. Alternatively, you can modify the definition of the A_NAME column to allow null values by removing the not null constraint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants