Database Reference
In-Depth Information
the join table query. By the following commands, we would try to join a table from Dy-
namoDB to a set of flat file present on AWS S3:
-- A DynamoDB table
CREATE EXTERNAL TABLE packtPubEmployee (empid String, yoj
String, department String, salary bigint, ,manager String)
STORED BY
'org.apache.hadoop.hive.dynamodb.DynamoDBStorageHandler'
TBLPROPERTIES ("dynamodb.table.name" = "Employee",
"dynamodb.column.mapping" =
"empid:empId,yoj:yoj,department:dept,salary:salary,manager:manager");
-- A table created from S3 flat files
CREATE EXTERNAL TABLE packtPubDepartment (department
String, name String, head String)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
LOCATION 's3://bucket/path/';
-- Join the tables
SELECT e.empid , d.name FROM
packtPubEmployee e JOIN packtPubDepartment d
ON (e.department = d.department);
Again the output would be employee ID with its corresponding department name.
Search WWH ::




Custom Search