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,650 points
1,068 views

1 answer to this question.

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,350 points

Related Questions In Database

0 votes
0 answers

Modify an existing Excel file using Openpyxl in Python

I am basically trying to copy some ...READ MORE

Mar 25, 2022 in Database by Edureka
• 13,690 points
2,056 views
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,390 points
651 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,390 points
3,924 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,390 points
866 views
0 votes
1 answer
+1 vote
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
• 11,380 points
11,028 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,832 views
–1 vote
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,350 points
4,612 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,350 points
1,469 views
0 votes
1 answer

Delete row in HBase

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

answered Jul 24, 2018 in Database by kurt_cobain
• 9,350 points
1,791 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP