Halloween Sale: Flat 70% + Addl. 25% Off + 30 Days Extra Lab on all Courses | Use Coupon HS25 in Checkout | Offer Expires InEnroll Now
Transcript: Let's login to the console. Start the Hbase interactive shell using: hbase shell We will be typing our HBase commands here. Let us first create a table with name as our login followed by underscore and then console. For our case since my login is sandeepgiri9034 the exact command is:
create 'sandeepgiri9034_console', 'contents','anchors'
Please note that all the strings which is table names and column families are surrounded by single quotes. You can see more commands by typing
Now, let us add the first record.
Add first cell - put tablename rowkey column identifier and then cell value, So the exact command is:
put 'sandeepgiri9034_console', 'com.cnn.www', 'contents:', '<h1> Welcome to CNN - Breaking news. </h1>'
Now, let's add the second and third column to the same row_key.
put 'sandeepgiri9034_console', 'com.cnn.www', 'anchors:si.com', 'CNN'
put 'sandeepgiri9034_console', 'com.cnn.www', 'anchors:microsoft.com', 'CNN News'
To see the entire table, we can use
scan, the exact command is:
We can delete a table by first disabling it, so to delete my table I can use
and again the name of the table or the name of the column family or the contents is surrounded by single quotes. Once disabled we can drop the table by using
drop followed by table name:
If we try to scan the deleted table, it would throw an error "Unknown table".
To see the list of tables you can use list command. You can also provide regular expression to filter out the results of list command by providing list space regular expression to match with the table name.
list 'san.*' would list all the tables starting with "san".
This regular expression that you see on the screen lists the tables ending with four digits.
To exit we simply press control d.
No hints are availble for this assesment
Answer is not availble for this assesment