【问题标题】:Tarantool - creating primary indexTarantool - 创建主索引
【发布时间】:2017-12-07 05:11:10
【问题描述】:

我正在关注the tarantool documentation,但在创建索引时出现错误。

我想了解为什么会失败,因为我完全按照教程进行操作。

$ tarantool
tarantool: version 1.6.7-591-g7d4dbbb
type 'help' for interactive help
tarantool> box.cfg{listen = 3301}
2017-12-06 20:57:18.684 [15168] main/101/interactive C> version 1.6.7-591-g7d4dbbb
2017-12-06 20:57:18.684 [15168] main/101/interactive C> log level 5
2017-12-06 20:57:18.684 [15168] main/101/interactive I> mapping 1073741824 bytes for tuple arena...
2017-12-06 20:57:18.705 [15168] main/101/interactive I> initializing an empty data directory
2017-12-06 20:57:18.710 [15168] snapshot/101/main I> creating `./00000000000000000000.snap.inprogress'
2017-12-06 20:57:18.710 [15168] snapshot/101/main I> saving snapshot `./00000000000000000000.snap.inprogress'
2017-12-06 20:57:18.710 [15168] snapshot/101/main I> done
2017-12-06 20:57:18.713 [15168] iproto I> binary: started
2017-12-06 20:57:18.713 [15168] iproto I> binary: bound to 0.0.0.0:3301
2017-12-06 20:57:18.713 [15168] main/101/interactive I> ready to accept requests
---
...


tarantool> s = box.schema.space.create('tester')
2017-12-06 20:57:32.803 [15168] wal/101/main I> creating `./00000000000000000000.xlog.inprogress'
---
...

tarantool> s:create_index('primary', {
         > type = 'hash',
         > parts = {1, 'unsigned'}
         > })
---
- error: 'Can''t create or modify index ''primary'' in space ''tester'': unknown field
    type'
...

【问题讨论】:

    标签: tarantool


    【解决方案1】:

    你使用的是 Tarantool 1.6,所以我相信你应该有

    parts = {1, 'NUM'}
    

    在教程示例中。您显示的代码(“未签名”)适用于 1.7,因此一种选择是升级您的 Tarantool 版本。同样在文档中,您可以在右上角的 Tarantool 1.6、1.7 和 1.8 之间进行切换。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-02
      • 2016-03-01
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 2023-03-08
      相关资源
      最近更新 更多