我在 CQL3 中有一张这样的表
create table product_info
(
key text,
value text,
Primary key (key)
);
它是一个垂直的桌子。因为我可以使用 (key , value ) 对插入新行。
样本数据将是:
产品信息
key | value
-------------------------------------------
product_name | sample_product
quantity | 2
manufacture | sample_manufacturer
.... ....
但我需要的是一个水平表,我可以在不改变表的情况下动态添加列。
产品信息
product_name | quantity | manufacture | ....
------------------------------------------------------------------------------
sample_product | 2 | sample_manufacturer | ....
我需要像上表这样的结构,需要不断添加列。
CQL3 提供了动态添加列的选项,但在此之前我们需要更改表。
我需要知道是否有任何其他方法可以做到这一点。
我发现通过使用 thrift api 是可能的,但是由于不支持 thrift,所以不能使用它。
是否有任何其他 API,如 hector 或其他支持此功能的 API?
我确实经历了类似的堆栈溢出帖子,但我没有得到更好的解决方案。