Elassandra 没有索引 UDT

Elassandra not indexing UDT

elassandra 5.5.018 和 6.2.3.2 会出现此错误。 我有这个 table 结构:

CREATE TYPE applicationinfo (
    industry text,
    area_of_application text,
    product_group text,
    sic_code text,
    conveyed_product text,
    flowability text,
    viscosity text,
    solids_content text,
    size_of_solids text,
    concentration text,
    composition text,
    specific_gravity text,
    ph_value text,
    product_temperature_min int,
    product_temperature_max int
);


CREATE TABLE deviceinfo (
    id text,
    "applicationinfo" applicationinfo
    PRIMARY KEY (id)
);

在我的测试用例中有一些(插入了大约 100 个条目)。 当我尝试为 deviceinfo table 创建弹性索引时,它失败并出现以下异常:

2018-07-04 14:49:56,894 ERROR [SecondaryIndexManagement:3] CassandraDaemon.java:231 uncaughtException Exception in thread Thread[SecondaryIndexManagement:3,5,main]
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.nio.BufferUnderflowException
    at org.apache.cassandra.utils.Throwables.maybeFail(Throwables.java:51)
    at org.apache.cassandra.utils.FBUtilities.waitOnFutures(FBUtilities.java:373)
    at org.apache.cassandra.index.SecondaryIndexManager.buildIndexesBlocking(SecondaryIndexManager.java:392)
    at org.apache.cassandra.index.SecondaryIndexManager.buildIndexesBlocking(SecondaryIndexManager.java:367)
    at org.apache.cassandra.index.SecondaryIndexManager.buildIndexBlocking(SecondaryIndexManager.java:288)
    at org.elassandra.index.ElasticSecondaryIndex.lambda$getInitializationTask(ElasticSecondaryIndex.java:2266)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator[=11=](NamedThreadFactory.java:81)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: java.nio.BufferUnderflowException
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.cassandra.utils.FBUtilities.waitOnFutures(FBUtilities.java:366)
    ... 9 common frames omitted

我做错了什么?

回答自己的问题。问题已在此处解决:

https://github.com/strapdata/elassandra/issues/210

解决办法是冻结udt字段:

CREATE TABLE deviceinfo (
    id text,
    "applicationinfo" frozen<applicationinfo>,
    baseinfo frozen<baseinfo>,
    "product" frozen<product>,
    "specification" frozen<specification>,
    "technicaldata" frozen<technicaldata>,
    "customer" frozen<customer>,
    PRIMARY KEY (id)
);