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

Spring Data Cassandra Turkish Locale Error [DATACASS-805] #971

Closed
spring-projects-issues opened this issue Sep 19, 2020 · 2 comments
Closed

Spring Data Cassandra Turkish Locale Error [DATACASS-805] #971

spring-projects-issues opened this issue Sep 19, 2020 · 2 comments
Assignees

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Sep 19, 2020

Siddik Acil opened DATACASS-805 and commented

Gist: Spring Data Cassandra fails when using TR locale (-Duser.language=tr) if you have typenames that contains 'I' or 'i'. (UUID, String, int)

I got the error at attachment file spring-cassandra-dump.txt when I was working on a simple demo with my work pc which has Turkish locale. 

// Caused by: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Type Not Found. Could not find user defined type
CREATE TABLE IF NOT EXISTS customer (id uuıd, name text, PRIMARY KEY (id));

Having had similar experiences with Turkish locale, I passed -Duser.language=en and everything starts working expectedly.

This is most probably due to notoriously famous Turkey test. Turkish locale has a dotless ı which has a "weird" conversion rule that only makes sense to native Turkish speakers.

For more info on Turkish I and İ refer to this link

The query builder has an uppercase typename lowercased with default locale but I could not find where.

I have attached a sample spring project with docker-compose.yml that spins up a YugabyteDB instance.

Steps to reproduce.

Get the GitHub repo.
Go into compose/master-slave execute "docker-compose up"
Get spring project up and running via VM option -Duser.language=tr


Reference URL: https://github.com/Akaame/SpringCassandraYugabyte

Attachments:

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 21, 2020

Mark Paluch commented

Thanks for the details. After having a look at the CQL generator, the translation into a Turkish i without dot happens within the Cassandra driver. Spring Data specifically calls type.asCql(true, true). The driver's PrimitiveType renders the type name with codeName(protocolCode).toLowerCase()

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 21, 2020

Mark Paluch commented

I filed a bug report for the Cassandra driver and attached the link to the ticket.

Looking at the Spring Data code, we use toLowerCase in a few places, mostly column name derivation. Using uppercase characters lead also to a Turkish ı. Lowercase i are retained as i which is a good way to work around letter casing rules.

Once the driver has addressed the issue, we're going to upgrade to the new driver version anyway so closing the ticket here

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.