Wa0006.
Wa0006.
◼ An OLTP application
◼ Low latency Database access
◼ Transactional database (ACID)
◼ Row level inserts, updates or deletes – hive 0.14 allows update and
delete.
OLTP vs OLAP
OLTP (On-line Transaction Processing)
- OLTP is characterized by a large number of short on-line transactions (INSERT, UPDATE, DELETE).
- very fast query processing
- maintaining data integrity in multi-access environments
- effectiveness measured by number of transactions per second.
- In OLTP database there is detailed and current data.
• To dropping a partition
ALTER TABLE stations
DROP PARTITON (year=2012);
Processing of hive table by creating Partition
Step 1 -Creation of Table all states
• FROM EMPLOYEES
• INSERT OVERWRITE TABLE SAMPLE_BUCKET
• SELECT first_Name, job_id, department, salary, country ;
◼ Use LOCAL when the file to be loaded resides in the local file system
and not HDFS
◼ Use LOCAL to copy a file to Hive table location
◼ Use OVERWRITE if data is not to be appended
Load into Partitioned data
◼ In UNION ALL : column names, data types & number of columns in all
queries used for uniting should match exactly.
◼ Sub Queries in hive should always be given an alias name e.g. ‘temp’
in this query
CASE statement
◼ Case statements are like IF-THEN-ELSE
◼ Example : We want to categorize stations into either “Missing” or
“Eastern Hemisphere” based on their longitude values
• https://career.guru99.com/top-30-hive-interview-questions/
https://letsfindcourse.com/hadoop-questions/pig-hadoop-mcq-questions