Home Interview Questions and AnswersTechnical Interview Questions and AnswersHive Hive Interview Questions and Answers For Freshers Part-5

hive41.Can we LOAD data into a view?
No. A view can not be the target of a INSERT or LOAD statement.

42.What types of costs are associated in creating index on hive tables?
Indexes occupies space and there is a processing cost in arranging the values of the column on which index is cerated.

43.Give the command to see the indexes on a table.
SHOW INDEX ON table_name

This will list all the indexes created on any of the columns in the table table_name.

44.What is bucketing ?
The values in a column are hashed into a number of buckets which is defined by user. It is a way to avoid too many partitions or nested partitions while ensuring optimizes query output.

45.What does /*streamtable(table_name)*/ do?
It is query hint to stream a table into memory before running the query. It is a query optimization Technique.

46.Can a partition be archived? What are the advantages and Disadvantages?
Yes. A partition can be archived. Advantage is it decreases the number of files stored in namenode and the archived file can be queried using hive. The disadvantage is it will cause less efficient query and does not offer any space savings.

47.What is a generic UDF in hive?
It is a UDF which is created using a java program to server some specific need not covered under the existing functions in Hive. It can detect the type of input argument programmatically and provide appropriate response.

48.The following statement failed to execute. What can be the cause?
LOAD DATA LOCAL INPATH ‘${env:HOME}/country/state/’
OVERWRITE INTO TABLE address;
The local inpath should contain a file and not a directory. The $env:HOME is a valid variable available in the hive environment.

49.How do you specify the table creator name when creating a table in Hive?
The TBLPROPERTIES clause is used to add the creator name while creating a table.

The TBLPROPERTIES is added like −

TBLPROPERTIES(‘creator’= ‘Joan’)

50.How do you check if a particular partition exists?
This can be done with following query

SHOW PARTITIONS table_name PARTITION(partitioned_column=’partition_value’)

You may also like

Leave a Comment