Hive interview questions part-4

What are the different types of tables available in HIve?

There are two types. Managed table and external table. In managed table both the data an schema in under control of hive but in external table only the schema is under control of Hive.

No Hive does not provide insert and update at row level. So it is not suitable for OLTP system.

Alter Table table_name RENAME TO new_name

Using REPLACE column option

ALTER TABLE table_name REPLACE COLUMNS ……

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

Depending on the nature of data the user has, the inbuilt SerDe may not satisfy the format of the data. SO users need to write their own java code to satisfy their data format requirements.

Hive is a tool in Hadoop ecosystem which provides an interface to organize and query data in a databse like fashion and write SQL like queries. It is suitable for accessing and analyzing data in Hadoop using SQL syntax.

hdfs://namenode_server/user/hive/warehouse

  • Local mode
  • Distributed mode
  • Pseudodistributed mode

Yes. The TIMESTAMP data types stores date in java.sql.timestamp format

There are three collection data types in Hive.

  • ARRAY
  • MAP
  • STRUCT

Yes, using the ! mark just before the command.

For example !pwd at hive prompt will list the current directory.

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.

Using the source command.

Example −

Hive> source /path/to/file/file_with_query.hql

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.

Comments

Popular posts from this blog

MongoDB - Data Modelling

SPARK - Deployment

SQOOP