0
0
Hadoopdata~10 mins

CRUD operations in HBase in Hadoop - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new HBase table named 'students'.

Hadoop
create '[1]', 'info'
Drag options to blanks, or click blank then click option'
Ateachers
Bclasses
Cstudents
Dsubjects
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong table name like 'teachers' or 'classes'.
Omitting the column family name.
2fill in blank
medium

Complete the code to insert a value 'John' into the 'name' column of the 'info' column family for row 'row1' in the 'students' table.

Hadoop
put 'students', 'row1', 'info:[1]', 'John'
Drag options to blanks, or click blank then click option'
Aaddress
Bage
Cgrade
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong column qualifier like 'age' or 'grade'.
Mixing up column family and column qualifier.
3fill in blank
hard

Fix the error in the code to retrieve the value of the 'name' column from the 'info' column family for row 'row1' in the 'students' table.

Hadoop
get 'students', 'row1', '[1]'
Drag options to blanks, or click blank then click option'
Ainfo:name
Binfo-name
Cinfo_name
Dname:info
Attempts:
3 left
💡 Hint
Common Mistakes
Using a dash '-' or underscore '_' instead of colon ':'.
Reversing the order of column family and column.
4fill in blank
hard

Fill both blanks to delete the 'age' column from the 'info' column family for row 'row2' in the 'students' table.

Hadoop
delete 'students', '[1]', '[2]'
Drag options to blanks, or click blank then click option'
Arow2
Brow1
Cinfo:age
Dinfo:name
Attempts:
3 left
💡 Hint
Common Mistakes
Deleting the wrong row or column.
Using incorrect column format like 'info-name'.
5fill in blank
hard

Fill all three blanks to create a dictionary of all 'name' values from the 'info' column family for rows in the list ['row1', 'row2', 'row3'].

Hadoop
names = { [1]: get('students', [2], '[3]').value for [1] in ['row1', 'row2', 'row3'] }
Drag options to blanks, or click blank then click option'
Arow
B'name'
Cinfo:name
D'row'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names in the loop and get function.
Incorrect column name format.