0
0
Hadoopdata~20 mins

CRUD operations in HBase in Hadoop - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
HBase CRUD Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this HBase shell command?
Consider the following HBase shell commands executed sequentially:

create 'students', 'info'
put 'students', 'row1', 'info:name', 'Alice'
put 'students', 'row1', 'info:age', '21'
get 'students', 'row1', 'info:name'

What will be the output of the get command?
Hadoop
create 'students', 'info'
put 'students', 'row1', 'info:name', 'Alice'
put 'students', 'row1', 'info:age', '21'
get 'students', 'row1', 'info:name'
A
COLUMN              CELL
 info:age            timestamp=..., value=21
B
COLUMN              CELL
 info:age            timestamp=..., value=Alice
C
COLUMN              CELL
 info:name           timestamp=..., value=21
D
COLUMN              CELL
 info:name           timestamp=..., value=Alice
Attempts:
2 left
💡 Hint
The get command retrieves the value of the specified column for the given row.
data_output
intermediate
1:30remaining
How many rows remain after this delete operation?
Given a table 'employees' with rows 'emp1', 'emp2', and 'emp3', after running:

deleteall 'employees', 'emp2'

How many rows will remain in the table?
Hadoop
deleteall 'employees', 'emp2'
A2
B3
C1
D0
Attempts:
2 left
💡 Hint
The deleteall command removes all columns for the specified row.
🔧 Debug
advanced
2:00remaining
Identify the error in this HBase shell command sequence
What error will occur when running this sequence?

create 'products', 'details'
put 'products', 'p1', 'details:name', 'Laptop'
put 'products', 'p1', 'details:price', 1200
get 'products', 'p1', 'details:price'
Hadoop
create 'products', 'details'
put 'products', 'p1', 'details:name', 'Laptop'
put 'products', 'p1', 'details:price', 1200
get 'products', 'p1', 'details:price'
ATypeError because 1200 is not a string
BNo error; output shows price as '1200'
CSyntaxError due to missing quotes around 1200
DNullPointerException because 'products' table does not exist
Attempts:
2 left
💡 Hint
HBase shell converts numbers to strings automatically in put.
🚀 Application
advanced
1:30remaining
Which command updates a cell value in HBase?
You want to change the value of the cell in row 'r1', column 'info:status' to 'active' in the 'users' table. Which command will do this?
Amodify 'users', 'r1', 'info:status', 'active'
Bupdate 'users', 'r1', 'info:status', 'active'
Cput 'users', 'r1', 'info:status', 'active'
Dset 'users', 'r1', 'info:status', 'active'
Attempts:
2 left
💡 Hint
HBase uses put to insert or update data.
🧠 Conceptual
expert
1:30remaining
What happens if you try to get a non-existent row in HBase?
If you run get 'orders', 'order999' but 'order999' does not exist in the 'orders' table, what will be the result?
Hadoop
get 'orders', 'order999'
AReturns an empty result with no columns
BRaises a KeyError exception
CReturns the last row in the table
DReturns null and stops the shell
Attempts:
2 left
💡 Hint
HBase returns empty results for missing rows instead of errors.