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

Sink Connector - Postgresql - Incorrect Handling of Default Value for Boolean Type #173

Open
kmurthyhegde opened this issue Jul 16, 2022 · 2 comments

Comments

@kmurthyhegde
Copy link

Problem Description
Below is the schema of a boolean field (in Kafka Topic)
{
"default": true,
"field": "is_active",
"optional": false,
"type": "boolean"
}

Set the auto.create to true in the sink connector configurations.

The sink connector fails to auto create the table with the below error message:

ERROR: column "is_active" is of type boolean but default expression is of type integer

This is because the sink connector, in it's DDL, has the default value as 1 for the boolean column, instead of true.

Please let me know if there is any workaround for this issue.

@mahavir155
Copy link

@kmurthyhegde Did you found out any work around?
I too git this same issue

@jeqo
Copy link
Contributor

jeqo commented Jan 31, 2024

@kmurthyhegde @mahavir155 sorry for the lack of response for a long time.

Could you confirm if this is still an issue? If it is, could you provide further detail on the postgres version? As far as I can see, boolean types support '1'/'0' as values: https://www.postgresql.org/docs/current/datatype-boolean.html as defined here:

Another workaround may be to create the table before hand before starting the connector.

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