You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by sendoh <un...@gmail.com> on 2019/06/28 14:50:37 UTC

Kafka Connect JDBC Sink - SQLServerException: Column in table is of a type that is invalid for use as a key column in an index

I encounter the same issue as https://github.com/confluentinc/kafka-connect-jdbc/issues/379

I think I could contribute to implement a custom `buildCreateTableStatement` in SqlServerDatabaseDialect that checks if primary key is a string, set it as VARCHAR(450) and logs it as warning.

any suggestion?


Re: Kafka Connect JDBC Sink - SQLServerException: Column in table is of a type that is invalid for use as a key column in an index

Posted by sendoh <un...@gmail.com>.
Just checked the constraint, and  the maximum is 900 for varchar before SQL Server 2016

On 2019/06/28 14:55:01, sendoh  <un...@gmail.com> wrote: 
> 
> 
> On 2019/06/28 14:50:37, sendoh  <un...@gmail.com> wrote: 
> > I encounter the same issue as https://github.com/confluentinc/kafka-connect-jdbc/issues/379
> > 
> > I think I could contribute to implement a custom `buildCreateTableStatement` in SqlServerDatabaseDialect that checks if primary key is a string, set it as VARCHAR(450) and logs it as warning.
> > 
> > any suggestion?
> > 
> > 
> or simply like the HANA implementation which only uses 1000 for VARCHAR
> https://github.com/confluentinc/kafka-connect-jdbc/blob/bb352573e68698b14045e3fceed5d9b7632eb9e4/src/main/java/io/confluent/connect/jdbc/dialect/SapHanaDatabaseDialect.java#L102
> 

Re: Kafka Connect JDBC Sink - SQLServerException: Column in table is of a type that is invalid for use as a key column in an index

Posted by sendoh <un...@gmail.com>.

On 2019/06/28 14:50:37, sendoh  <un...@gmail.com> wrote: 
> I encounter the same issue as https://github.com/confluentinc/kafka-connect-jdbc/issues/379
> 
> I think I could contribute to implement a custom `buildCreateTableStatement` in SqlServerDatabaseDialect that checks if primary key is a string, set it as VARCHAR(450) and logs it as warning.
> 
> any suggestion?
> 
> 
or simply like the HANA implementation which only uses 1000 for VARCHAR
https://github.com/confluentinc/kafka-connect-jdbc/blob/bb352573e68698b14045e3fceed5d9b7632eb9e4/src/main/java/io/confluent/connect/jdbc/dialect/SapHanaDatabaseDialect.java#L102