Beruflich Dokumente
Kultur Dokumente
http://localhost:60010
version
# describe
describe 'Student'
# disable
disable 'Student'
# is_disabled
is_disabled 'Student'
# disable_all
disable_all 'S.*'
# enable
enable 'Student'
# is_enabled
is_enabled 'Student'
# enable_all
enable_all 'S.*'
#Alter table
alter 'Student', NAME => 'CF1', VERSIONS => 5
alter 'Student1', 'delete' => 'CF3'
#exists
exists 'Student'
#drop
disable 'Student'
drop 'Student'
#drop_all
disable_all 'S.*'
drop_all 's.*'
# Auto delete data after TTL (Time to Live), Block Size, Compression
create 'Student1', {NAME => 'CF1', TTL => '18000', BLOCKSIZE => '65536',COMPRESSION
=> 'SNAPPY'}
# Truncate table
truncate 'Student'
- Disabling table...
- Dropping table...
- Creating table...
count 'Student'
# In hive
CREATE EXTERNAL TABLE StudentHive (StID String, StName String, StYear int, StScore
int, StRegion String) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ('hbase.columns.mapping' =
':key,CF1:StName,CF1:StYear,CF1:StScore,CF1:StRegion') TBLPROPERTIES
('hbase.table.name' = 'StudentHBase');
CREATE TABLE Stemp (StID String, StName String, StYear int, StScore int, StRegion
String) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';
Load Data Local inpath '/home/training/Desktop/Student' into table Stemp;
Java Statements:
----------------
admin.enableTable("Student");
admin.disableTable("Student");
admin.addColumn("Student", columnDescriptor);
boolean bool = admin.tableExists("emp");
admin.deleteTable("emp12");
admin.shutdown();
# Bulkload
hadoop jar $HBASE_HOME/hbase-0.94.10.jar importtsv
-Dimporttsv.columns=HBASE_ROW_KEY,CF1:StName,CF1:StYear,CF1:StScore,CF1:StRegion '-
Dimporttsv.separator=,' 'Student' '/Student'