column-family

How to Create a Column family in a Selected Cluster in HBase

China☆狼群 提交于 2019-12-12 01:58:47
问题 In cassandra hector API allow to create table on a selected cluster as follows. I want to do the same thing using HBase, can someone please help me out? This is how it can done using Cassandra : public void createColumnFamily(Cluster cluster, String tableName, String columnFamilyName, StreamDefinition streamDefinition) { } 回答1: There is no such concept of cluster namespace in HBase. You can simple create a table in HBase using methods of HBaseAdmin class. HBaseConfiguration conf =

Composite Column Values in Cassandra?

落花浮王杯 提交于 2019-12-12 01:14:48
问题 Can we have a composite values in each columns in Cassandra Column Family? user-id column1-name 123 (Column1-Value Column1-SchemaName Column1-LastModifiedDate) userId is the rowKey here. And same thing will be for other columns as well. Each column value will contain below three things always- ByteType for Column-Value UTF8Type for Column-SchemaName DateType for LastModifiedDate If yes, can anyone help me in designing the column family for this? I will be using Astyanax client to insert into

Not enough bytes to read value of component using Composite Columns with Astyanax client

前提是你 提交于 2019-12-11 09:46:46
问题 I am tyring to insert into Composite Column in Cassandra column family using Astyanax client. Below is my column family in Cassandra. create column family USER_DATA with key_validation_class = 'UTF8Type' and comparator = 'CompositeType(UTF8Type,UTF8Type,DateType)' and default_validation_class = 'UTF8Type' and gc_grace = 86400; I am expecting after insertion, it will look like this user-id column1 123 (Column1-Value Column1-SchemaName LastModifiedDate) Below is my java main code- public static

What are best practices for deleting/altering cassandra columns of collection data-type?

£可爱£侵袭症+ 提交于 2019-12-08 09:45:58
问题 In our Cassandra table, every time we change data-types of "collection-type" columns it start causing issue. For example: For changing datatype from text to Map<text,float> we do this: drop existing column wait for cassandra to assimilate this change. add column (same name) but different data-type. This reflects fine in all nodes, but Cassandra logs start complaining during compaction with: RuntimeException: 6d6...73 is not defined as a collection I figured out the comparator entries are not

How to add new column family to an existing HBase table?

柔情痞子 提交于 2019-12-01 02:28:56
I created a table by create 'tablename', 'columnfamily1' Now is it possible to add another column family 'columnfamily2'? What is the method? It seems alter 'tablename', 'columnfamily2' does the trick. One may, disable 'tablename' first. However, it works fine even if enabled. hbase(main):015:0> alter 'tablename', {NAME=> 'columnfamily2'} Updating all regions with the new schema... 0/1 regions updated. 1/1 regions updated. Done. alter 'tablename', NAME => 'newcolumnfamily', VERSIONS => 50 you can specify various properties of the new column family separated by a comma (,) If you consider some

How to add new column family to an existing HBase table?

大城市里の小女人 提交于 2019-11-30 21:58:45
问题 I created a table by create 'tablename', 'columnfamily1' Now is it possible to add another column family 'columnfamily2'? What is the method? 回答1: It seems alter 'tablename', 'columnfamily2' does the trick. One may, disable 'tablename' first. However, it works fine even if enabled. hbase(main):015:0> alter 'tablename', {NAME=> 'columnfamily2'} Updating all regions with the new schema... 0/1 regions updated. 1/1 regions updated. Done. 回答2: alter 'tablename', NAME => 'newcolumnfamily', VERSIONS

Cassandra has a limit of 2 billion cells per partition, but what's a partition?

天大地大妈咪最大 提交于 2019-11-27 17:43:04
In Cassandra Wiki, it is said that there is a limit of 2 billion cells (rows x columns) per partition. But it is unclear to me what is a partition? Do we have one partition per node per column family, which would mean that the max size of a column family would be 2 billion cells * number of nodes in the cluster. Or will Cassandra create as much partitions as required to store all the data of a column family? I am starting a new project so I will use Cassandra 2.0. RussS With the advent of CQL3 the terminology has changed slightly from the old thrift terms. Basically Create Table foo (a int , b