Hive interview questions - 6

31. What is .hiverc file ?
It is a file that is executed when you launch the hive shell - making it an ideal place for adding any hive configuration/customization you want set, on start of the hive shell. This could be:
- Setting column headers to be visible in query results
- Making the current database name part of the hive prompt
- Adding any jars or files
- Registering UDFs
 location is: /etc/hive/conf.cloudera.hive1

32. What is .hiverc and can you give a sample .hiverc ?
add jar /home/airawat/hadoop-lib/hive-contrib-0.10.0-cdh4.2.0.jar;
set hive.exec.mode.local.auto=true;
set hive.cli.print.header=true;
set hive.cli.print.current.db=true;
set hive.auto.convert.join=true;
set hive.mapjoin.smalltable.filesize=30000000;

33. 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

34. 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.

35. How do you list all databases whose name starts with p ?
SHOW DATABASES LIKE ‘p.*’

36. 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.
USE database_name;
USE DEFAULT;
USE sets the current database for all subsequent HiveQL statements. To revert to the default database, use the keyword "default" instead of a database name.


12345678910