0

在中,如果从 usingScalarDB输入一行,则 tx 字段的值应该是多少?cqlshDistributedTransaction

我的表的架构是

CREATE TABLE codingjedi.supported_tags (
    course text,
    subject text,
    topic text,
    before_tx_committed_at bigint,
    before_tx_id text,
    before_tx_prepared_at bigint,
    before_tx_state int,
    before_tx_version int,
    tx_committed_at bigint,
    tx_id text,
    tx_prepared_at bigint,
    tx_state int,
    tx_version int,
    PRIMARY KEY (course, subject, topic)
)

cqlsh我直接从表中填充了一些条目INSERT INTO supported_tags (course, subject, topic) VALUES ('coding','Perl','empty' ) IF NOT EXISTS;

但这离开tx_committed_at tx_id, tx_prepared_at, tx_state, tx_version null。我认为这在我执行get. 我得到一个例外invalid id specified.. Cause: null

我可以在表中添加行cqlsh吗?

4

1 回答 1

2

不建议这样做。不保证 Scalar DB 事务。最好通过 Scalar DB 事务填充记录。

我从来没有尝试过。我猜你可以设置3(这意味着committed)到tx_state,一个整数值到tx_version,一个 bigint 数字tx_*_at,和一个字符串tx_id

于 2020-12-11T04:03:16.280 回答