Hive Interview Questions and Answers For Freshers Part-2
12.Can we run unix shell commands from hive? Give example.
Yes, using the ! mark just before the command.
For example !pwd at hive prompt will list the current directory.
13.What is a Hive variable? What for we use it?
The hive variable is variable created in the Hive environment that can be referenced by Hive scripts. It is used to pass some values to the hive queries when the query starts executing.
14.Can hive queries be executed from script files? How?
Using the source command.
Hive> source /path/to/file/file_with_query.hql
15.What is the importance of .hiverc file?
It is a file containing list of commands needs to run when the hive CLI starts. For example setting the strict mode to be true etc.
16.What are the default record and field delimiter used for hive text files?
The default record delimiter is − \n
And the filed delimiters are − \001,\002,\003
17.What do you mean by schema on read?
The schema is validated with the data when reading the data and not enforced when writing data.
18.How do you list all databases whose name starts with p?
SHOW DATABASES LIKE ‘p.*’
19.What does the “USE” command in hive do?
With the use command you fix the database on which all the subsequent hive queries will run.
20.How can you delete the DBPROPERTY in Hive?
There is no way you can delete the DBPROPERTY.