0
votes

The first time I create a HBase table I want the table to be created with multiple columns in the following way(I know the following way wont work looking for similar kind of way)..

create 'table_name','col_family:column1','col_family:column2'

is this possible? Apart from using the put command and adding a column to a columnfamily dynamically is there any other way??

2
Why do you need to add a column before Put? HBase is schemaless, thus it is against its logic.gorros
actually i just need a hbase table to be created with colum_famliy and columns in it and a hive table will be pointed to it. My pyspark code inserts into the hive table and internally records will be inserted into the hbase table..sk7979
Isn't specifying schema in Hive enough?gorros
if i do so hive throws an error.. because there wont be any columns in the column family, While creating the hbase table and if want to have column families i have to use 'put' but, my requirement is to add columns at the time of creating the table itself not using 'put'.. is it possible??sk7979

2 Answers

1
votes

This is no possible. The column name under column family will be given only when we are inserting value. if you want to add column to CF try below.

put 'table_name', 'rowid','cf1:col1','Associate'
put 'table_name', 'rowid','cf1:col2','Hbase'

put 'table_name', 'rowid2','cf1:col1','PA'
put 'table_name', 'rowid2','cf1:col2','Hbase ,Hadoop'
put 'table_name', 'rowid2','cf1:col3','1'

For CF1 column family col3 column value is null.

0
votes

I think it is against HBase logic and it is not possible. I went through documentation and did not find any solution. In my understanding, column family is meta-data, but column qualifier may contain data similarly to cell value. Thus, if you don't have data you don't have column qualifier.