Interview Questions.

Top 100+ Apache Hive Interview Questions And Answers

fluid

Top 100+ Apache Hive Interview Questions And Answers

Question 1. What Are The Different Types Of Tables Available In Hive?

Answer :

There are two kinds. Managed desk and external desk. In controlled table both the facts an schema in beneath manipulate of hive however in outside table handiest the schema is underneath manipulate of Hive.

Question 2. Is Hive Suitable To Be Used For Oltp Systems? Why?

Answer :

No Hive does no longer offer insert and update at row level. So it isn't appropriate for OLTP system.

Apache Tapestry Interview Questions
Question 3. Can A Table Be Renamed In Hive?

Answer :

Alter Table table_name RENAME TO new_name

Question four. Can We Change The Data Type Of A Column In A Hive Table?

Answer :

Using REPLACE column choice

ALTER TABLE table_name REPLACE COLUMNS ……

Apache Tapestry Tutorial
Question five. What Is A Metastore In Hive?

Answer :

It is a relational database storing the metadata of hive tables, partitions, Hive databases etc

Apache Cassandra Interview Questions
Question 6. What Is The Need For Custom Serde?

Answer :

Depending on the character of statistics the consumer has, the in-built SerDe may not satisfy the layout of the data. SO customers want to write down their personal java code to fulfill their information layout necessities.

Question 7. Why Do We Need Hive?

Answer :

Hive is a device in Hadoop ecosystem which provides an interface to arrange and query records in a databse like style and write SQL like queries. It is appropriate for having access to and analyzing data in Hadoop the use of SQL syntax.

Apache Cassandra Tutorial Apache Spark Interview Questions
Question 8. What Is The Default Location Where Hive Stores Table Data?

Answer :

hdfs://namenode_server/user/hive/warehouse

Question nine. What Are The Three Different Modes In Which Hive Can Be Run?

Answer :

Local mode
Distributed mode
Pseudodistributed mode
Apache Solr Interview Questions
Question 10. Is There A Date Data Type In Hive?

Answer :

Yes. The TIMESTAMP statistics sorts shops date in java.Sq..Timestamp layout

Apache Solr Tutorial
Question eleven. What Are Collection Data Types In Hive?

Answer :

There are 3 collection records sorts in Hive.

ARRAY
MAP
STRUCT
Apache Storm Interview Questions
Question 12. Can We Run Unix Shell Commands From Hive? Give Example?

Answer :

Yes, the use of the ! Mark just before the command.

For instance !Pwd at hive prompt will listing the modern directory.

Apache Tapestry Interview Questions
Question 13. What Is A Hive Variable? What For We Use It?

Answer :

The hive variable is variable created within the Hive surroundings that may be referenced with the aid of Hive scripts. It is used to pass a few values to the hive queries whilst the query begins executing.

Apache Storm Tutorial
Question 14. Can Hive Queries Be Executed From Script Files? How?

Answer :

Using the supply command.

Example: Hive> source /path/to/file/file_with_query.Hql

Question 15. What Is The Importance Of .Hiverc File?

Answer :

It is a record containing listing of instructions wishes to run whilst the hive CLI starts. For instance placing the strict mode to be real and so on.

Apache Pig Interview Questions
Question 16. What Are The Default Record And Field Delimiter Used For Hive Text Files?

Answer :

The default record delimiter is − n

And the filed delimiters are − 01,02,03

Apache Hive Tutorial
Question 17. What Do You Mean By Schema On Read?

Answer :

The schema is established with the statistics whilst studying the statistics and not enforced when writing information.

Apache Flume Interview Questions
Question 18. How Do You List All Databases Whose Name Starts With P?

Answer :

SHOW DATABASES LIKE ‘p.*’

Apache Cassandra Interview Questions
Question 19. What Does The “use” Command In Hive Do?

Answer :

With the use command you repair the database on which all the next hive queries will run.

Apache Pig Tutorial
Question 20. How Can You Delete The Dbproperty In Hive?

Answer :

There is not any manner you may delete the DBPROPERTY.

Apache Kafka Interview Questions
Question 21. What Is The Significance Of The Line Set Hive.Mapred.Mode = Strict;

Answer :

It units the mapreduce jobs to strict mode.By which the queries on partitioned tables cannot run with out a WHERE clause. This prevents very massive task running for long term.

Question 22. How Do You Check If A Particular Partition Exists?

Answer :

This can be completed with following query

SHOW PARTITIONS table_name PARTITION(partitioned_column=’partition_value’)

Apache Flume Tutorial
Question 23. Which Java Class Handles The Input Record Encoding Into Files Which Store The Tables In Hive?

Answer :

org.Apache.Hadoop.Mapred.TextInputFormat

Apache Ant Interview Questions
Question 24. Which Java Class Handles The Output Record Encoding Into Files Which Result From Hive Queries?

Answer :

org.Apache.Hadoop.Hive.Ql.Io.HiveIgnoreKeyTextOutputFormat

Apache Spark Interview Questions
Question 25. What Is The Significance Of ‘if Exists” Clause While Dropping A Table?

Answer :

When we difficulty the command DROP TABLE IF EXISTS table_name

Hive throws an error if the table being dropped does no longer exist in the first place.

Apache Kafka Tutorial
Question 26. When You Point A Partition Of A Hive Table To A New Directory, What Happens To The Data?

Answer :

The facts stays inside the antique place. It has to be moved manually.

Apache Camel Interview Questions
Question 27. Write A Query To Insert A New Column(new_col Int) Into A Hiev Table (htab) At A Position Before An Existing Column (x_col)

Answer :

ALTER TABLE table_name
CHANGE COLUMN new_col  INT
BEFORE x_col

Apache Solr Interview Questions
Question 28. Does The Archiving Of Hive Tables Give Any Space Saving In Hdfs?

Answer :

No. It only reduces the range of files which will become less difficult for namenode to manipulate.

Apache Ant Tutorial
Question 29. How Can You Stop A Partition Form Being Queried?

Answer :

By using the ENABLE OFFLINE clause with ALTER TABLE atatement.

Apache Tajo Interview Questions
Question 30. While Loading Data Into A Hive Table Using The Load Data Clause, How Do You Specify It Is A Hdfs File And Not A Local File ?

Answer :

By Omitting the LOCAL CLAUSE within the LOAD DATA assertion.

Question 31. If You Omit The Overwrite Clause While Creating A Hive Table,what Happens To File Which Are New And Files Which Already Exist?

Answer :

The new incoming files are simply brought to the goal directory and the existing documents are without a doubt overwritten. Other files whose call does not fit any of the incoming files will live on.

If you add the OVERWRITE clause then all the present records inside the directory might be deleted before new statistics is written.

Apache Tajo Tutorial
Question 32. What Does The Following Query Do? Insert Overwrite Table Employees Partition (usa, State) Select ..., Se.Cnty, Se.St From Staged_employees Se;

Answer :

It creates partition on desk employees with partition values coming from the columns inside the pick clause. It is called Dynamic partition insert.

Apache Impala Interview Questions
Question 33. What Is A Table Generating Function On Hive?

Answer :

A table generating feature is a feature which takes a unmarried column as argument and expands it to a couple of column or rows. Example exploe()

Apache Storm Interview Questions
Question 34. How Can Hive Avoid Mapreduce?

Answer :

If we set the assets hive.Exec.Mode.Neighborhood.Vehicle to true then hive will keep away from mapreduce to fetch query effects.

Question 35. What Is The Difference Between Like And Rlike Operators In Hive?

Answer :

The LIKE operator behaves the same manner because the ordinary SQL operators used in choose queries.

Example − street_name like ‘%Chi’

But the RLIKE operator uses extra advance ordinary expressions which are to be hadOho).*’ on the way to pick out any word which has both chi or oho in it.

Question 36. Is It Possible To Create Cartesian Join Between 2 Tables, Using Hive?

Answer :

No. As this kind of Join cannot be implemented in mapreduce

Apache Pig Interview Questions
Question 37. As Part Of Optimizing The Queries In Hive, What Should Be The Order Of Table Size In A Join Query?

Answer :

In a be a part of question the smallest desk to be taken inside the first position and largest desk ought to be taken within the ultimate role.

Question 38. What Is The Usefulness Of The Distributed By Clause In Hive?

Answer :

It controls how the map output is decreased most of the reducers. It is beneficial in case of streaming information.

Question 39. How Will You Convert The String ’fifty one.2’ To A Float Value In The Price Column?

Answer :

Select solid(price as FLOAT)

Question forty. What Will Be The Result When You Do Cast(‘abc’ As Int)?

Answer :

Hive will go back NULL

Apache Flume Interview Questions
Question 41. Can The Name Of A View Be Same As The Name Of A Hive Table?

Answer :

No. The call of a view have to be particular when as compared to all different tables and views gift within the equal database.

Question 42. Can We Load Data Into A View?

Answer :

No. A view can't be the goal of a INSERT or LOAD announcement.

Apache Kafka Interview Questions
Question forty three. What Types Of Costs Are Associated In Creating Index On Hive Tables?

Answer :

Indexes occupies area and there is a processing price in arranging the values of the column on which index is cerated.

Question forty four. Give The Command To See The Indexes On A Table?

Answer :

SHOW INDEX ON table_name

This will listing all the indexes created on any of the columns in the desk table_name.

Question forty five. What Is Bucketing ?

Answer :

The values in a column are hashed into some of buckets that is described by means of user. It is a way to keep away from too many walls or nested walls even as making sure optimizes query output.

Question 46. What Does /*streamtable(table_name)*/ Do?

Answer :

It is query hint to circulate a desk into reminiscence before jogging the query. It is a question optimization Technique.

Question 47. Can A Partition Be Archived? What Are The Advantages And Disadvantages?

Answer :

Yes. A partition may be archived. Advantage is it decreases the number of files stored in namenode and the archived file can be queried the usage of hive. The disadvantage is it will reason much less green question and does no longer provide any area financial savings.

Question forty eight. What Is A Generic Udf In Hive?

Answer :

It is a UDF that is created using a java software to server some unique want now not included under the existing functions in Hive. It can discover the form of input argument programmatically and provide suitable response.

Question 49. The Following Statement Failed To Execute. What Can Be The Cause? Load Data Local Inpath ‘$env:domestic/united states/nation/’ Overwrite Into Table Address;

Answer :

The neighborhood inpath must contain a file and not a directory. The $env:HOME is a valid variable available inside the hive environment.

Question 50. How Do You Specify The Table Creator Name When Creating A Table In Hive?

Answer :

The TBLPROPERTIES clause is used to feature the author call at the same time as developing a desk.
The TBLPROPERTIES is delivered like:  TBLPROPERTIES(‘creator’= ‘Joan’)




CFG