Database Reference
In-Depth Information
create 'customer', 'address'
Take note that no schema or columns were defined for the actual table or
the column family. This is intentional because the actual columns contained
within an address could vary.
At this point, you may be questioning why this is a desirable behavior.
There are actually a number of use cases; the easiest involves international
addresses. Consider a U.S. address that has parts like address1, address2,
city, state, and ZIP code. Other regions and countries do not necessarily
follow this same format, so the flexibility is desirable in this scenario.
Now,let'stake aquick lookathowweputdata into ourcustomer tableusing
the put statement:
put 'customer', 'row01', 'address:street', '123 Main
St.'
put 'customer', 'row01', 'address:city', 'Tampa'
put 'customer', 'row01', 'address:state', 'Florida'
put 'customer', 'row01', 'address:country', 'United
States of America'
put 'customer', 'row01', 'address:zip', '34637'
The format of this command specifies the table name ( customer ), the
row identifier ( row01 ), the column family and column name
( address:[xxx] ), and finally the value. When the commands complete,
the data is available for query operations.
NOTE
To drop an HBase table, you must first disable it, and then drop it. The
syntax to perform this operation is as follows:
disable 'customer'
drop 'customer'
Search WWH ::




Custom Search