Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create an HBase table with a column family.
Hadoop
create 'my_table', '[1]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a column name instead of a column family.
Omitting the quotes around the column family name.
✗ Incorrect
HBase tables require at least one column family, which is specified when creating the table.
2fill in blank
mediumComplete the code to put data into an HBase table.
Hadoop
put 'my_table', 'row1', '[1]', 'value1'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the row key or table name instead of the column identifier.
Forgetting the colon between column family and qualifier.
✗ Incorrect
Data is inserted into HBase by specifying the row key, column family and qualifier, and the value.
3fill in blank
hardFix the error in the code to get data from HBase.
Hadoop
get 'my_table', '[1]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the column identifier instead of the row key.
Using the table name instead of the row key.
✗ Incorrect
The get command requires the row key to retrieve data, not the column or table name.
4fill in blank
hardFill both blanks to scan an HBase table and filter rows with a specific prefix.
Hadoop
scan 'my_table', [1] => [2]('row')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using RowFilter or ValueFilter instead of PrefixFilter.
Omitting the FILTER keyword or curly braces.
✗ Incorrect
The scan command uses a FILTER with a PrefixFilter to select rows starting with a prefix.
5fill in blank
hardFill all three blanks to create a dictionary comprehension that maps row keys to values for rows with values greater than 10.
Hadoop
result = [1]: [2] for k, v in data.items() if v [3] 10
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong comparison operator.
Swapping keys and values in the comprehension.
✗ Incorrect
The comprehension maps keys to values where the value is greater than 10.