cassandra:〜.cqlshrc不适用于float_precision [英] cassandra: ~.cqlshrc does not work for float_precision

查看:291
本文介绍了cassandra:〜.cqlshrc不适用于float_precision的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 .cassandra 目录中创建了文件,并更改了 cqlshrc 文件。

I created file in .cassandra directory and changed the cqlshrc file.

[ui] float_precision = 10

但是没有工作。我在Ubuntu使用 ccm 与Cassandra。

But that did not work. I am using ccm with Cassandra in Ubuntu.

推荐答案

code> cqlshrc 文件,您需要指定 [ui] 部分并定义 float_precision 在单独的行。

Inside your cqlshrc file, you need to designate your [ui] section and define your float_precision on separate lines. In your example, it shows that you are defining them on the same line.

在这个例子中,您可以看到我有 cqlshrc 文件。当查询cqlsh中的浮点数时,默认值为5的精度。

Here you can see that I have my cqlshrc file defined as you do. When querying a float in cqlsh, it defaults to a precision of 5.

aploetz@dockingBay94:~$ cat .cassandra/cqlshrc
[ui] float_precision = 10

aploetz@dockingBay94:~$ cqlsh -u aploetz -p aploetz
Connected to VaporTrails at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.1 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.
aploetz@cqlsh> use stackoverflow ;
aploetz@cqlsh:stackoverflow> SELECT * FROm floattest;

 id                                   | value
--------------------------------------+---------
 d79fee54-e67b-4178-bfc9-155ffe6a9372 | 5.82375

(1 rows)

但是当我把它们放在单独的行,它会正确强制我需要的浮动精度:

But when I put them on separate lines, it properly enforces my desired float precision:

aploetz@dockingBay94:~$ cat .cassandra/cqlshrc
[ui]
float_precision = 10

aploetz@dockingBay94:~$ cqlsh -u aploetz -p aploetz
Connected to VaporTrails at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.1 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.
aploetz@cqlsh> use stackoverflow ;
aploetz@cqlsh:stackoverflow> SELECT * FROm floattest;

 id                                   | value
--------------------------------------+--------------
 d79fee54-e67b-4178-bfc9-155ffe6a9372 | 5.8237495422

(1 rows)

这篇关于cassandra:〜.cqlshrc不适用于float_precision的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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