如何读取大小写敏感的cassandra数据 [英] How to read cassandra data with out case sensitive

查看:497
本文介绍了如何读取大小写敏感的cassandra数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从cassandra获取数据,不区分大小写。请帮助我。

I need to get the data from cassandra with out case sensitive. Please help me.

推荐答案

Cassandra中没有区分大小写的概念。所有数据都存储为 byte [] ,所以它甚至不是一个字符串。

There is no case-sensitivity concept in Cassandra. All the data is stored as byte[], so it's not even a String.

比较器(请参阅API ),它会将 byte [] 到String并忽略大小写。

You can make a custom comparator (see the API) which transforms byte[] to String and disregards case.

另一件事情就是获取数据并在客户端进行转换。

The other thing to do is just get the data and transform it on the client side.

其实,你的问题是非常不清楚,因为你的目标是什么,所以我不能给更多的细节。

Actually, your question is quite unclear as of what is your goal, so I can't give more details.

更新:运行一次性作业,从数据库获取所有记录并更新它们,设置为小写。然后继续插入小写的所有内容。

Update: Run a one-time job that fetches all records from the db and updates them, setting to lower-case. Then continue inserting everything with lowercase.

这篇关于如何读取大小写敏感的cassandra数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆