Modify schema in HBase using Programs

0 votes
Is there a way to design or modify schema in HBase programmatically?
Aug 9, 2018 in Database by Ashish
• 2,630 points
16 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
HBase schemas can be created or updated using the Apache HBase Shell or by using Admin in the Java API.
Creating table schema:

Configuration config = HBaseConfiguration.create();

HBaseAdmin admin = new HBaseAdmin(conf); // execute command through admin</span></pre>

// Instantiating table descriptor class

HTableDescriptor t1 = new HTableDescriptor(TableName.valueOf("employee"));

// Adding column families to t1

t1.addFamily(new HColumnDescriptor("professional"));

t1.addFamily(new HColumnDescriptor("personal"));

// Create the table through admin

admin.createTable(t1);

For modification:

String table = “myTable”;

admin.disableTable(table);

admin.modifyColumn(table, cf2); // modifying existing ColumnFamily

admin.enableTable(table);

Hope this helps
answered Aug 9, 2018 by kurt_cobain
• 9,260 points

Related Questions In Database

0 votes
1 answer

Connection in Hbase

Following code is used to open a ...READ MORE

answered Jul 11, 2018 in Database by Data_Nerd
• 2,340 points
32 views
0 votes
1 answer

HLog and WAL in Hbase.

All edits in the HStore are stored ...READ MORE

answered Jul 16, 2018 in Database by Data_Nerd
• 2,340 points
311 views
0 votes
1 answer

Data model operations in Hbase

1. Get(returns attributes for a specified row, Gets ...READ MORE

answered Jul 16, 2018 in Database by Data_Nerd
• 2,340 points
23 views
0 votes
1 answer

Filters in HBase

ColumnPrefixFilter: takes a single argument, a column ...READ MORE

answered Jul 31, 2018 in Database by kurt_cobain
• 9,260 points
233 views
0 votes
1 answer
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 9,310 points
1,818 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
8,990 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,260 points
646 views
0 votes
1 answer

Standalone Mode in Hbase

It is a default mode of HBase. ...READ MORE

answered Jul 11, 2018 in Database by kurt_cobain
• 9,260 points
34 views
0 votes
1 answer

Delete row in HBase

In Hbase, whatever you write will be ...READ MORE

answered Jul 23, 2018 in Database by kurt_cobain
• 9,260 points
129 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.