Hive Quiz

Hive Beginner Quiz



Hive Quiz : This Hive Beginner Quiz contains set of 60 Hive Quiz which will help to clear any exam which is designed for Beginner.

Topics covered related to hive, apache hive, hadoop hive, hive hadoop, hive database, hive programming, database hive, hive in hadoop, data hive, what is hive in hadoop, big data hive, the hive, about hive and so on.

1) What are the main components of Big Data?

  1. MapReduce
  2. HDFS
  3. YARN
  4. All of these
Answer : D

 

2) What is the default HDFS block size?

  1. 32 MB
  2. 64 KB
  3. 128 KB
  4. 64 MB
Answer : D

 

3) Which of the following type of joins can be performed in Reduce side join operation?

  1. Equi Join
  2. Left Outer Join
  3. Right Outer Join
  4. All of the above
Answer : D

 

4) A Map reduce job can be written in:

  1. Java
  2. Ruby
  3. Python
  4. Any Language which can read from input stream
Answer : D

 

5) Which of the following are not possible in Hive?

  1. Creating Tables
  2. Creating Synonym
  3. Writing Update Statements
  4. Both (b) and (c)
Answer : D

 

6) Who will initiate the mapper?

  1. Task tracker
  2. Job tracker
  3. Combiner
  4. Reducer
Answer : A

 

7) Which of the following is not true about Name Node? (Select multiple answer)

  1. It is the Master Machine of the Cluster
  2. It is Name Node that can store user data
  3. Name Node is a storage heavy machine
  4. Name Node can be replaced by any Data Node Machine
Answer : (B)& (C) &(D)

 

8) Which of the following is true for Hive?

  1. Hive is the database of Hadoop
  2. Hive supports schema checking
  3. Hive doesn’t allow row level updates
  4. Hive can replace an OLTP system
Answer : C

 

9) Partitioned tables in Hive:

  1. Are aimed to increase the performance of the queries
  2. Modify the underlying HDFS structure
  3. Are not useful if the filter columns for query are different from the partition columns
  4. All of the above
Answer : D

 

10) HBase first reads the data from

  1. Block Cache
  2. Memstore
  3. HFile
  4. WAL
Answer : B

 

11) The partitioned columns in Hive tables are

  1. Physically present and can be accessed
  2. Physically absent but can be accessed
  3. Physically present but can’t be accessed
  4. Physically absent and can’t be accessed
Answer : B

 

12) What is the disadvantage of using too many partitions in Hive tables?

  1. It slows down the namenode
  2. Storage space is wasted
  3. Join quires become slow
  4. All of the above
Answer : D

 

13) The main advantage of creating table partition is

  1. Effective storage memory utilization
  2. Faster query performance
  3. Less RAM required by namenode
  4. Simpler query syntax
Answer : B

 

14) Which file controls the logging of Mapreduce Tasks?

  1. hive-log4j.properties
  2. hive-exec-log4j.properties
  3. hive-cli-log4j.properties
  4. hive-create-log4j.properties
Answer : B

 

15) The tables created in hive are stored as

  1. A file under the database directory
  2. A subdirectory under the database directory
  3. A .java file present in the database directory
  4. A HDFS block containing the database directory
Answer : B

 

16) On dropping a external table

  1. The schema gets dropped without dropping the data
  2. An error is thrown
  3. Both the schema and the data is dropped
Answer : A

 

17) The partition of an Indexed table is dropped. then,

  1. Corresponding partition from all indexes are dropped.
  2. No indexes are dropped
  3. Indexes refresh themselves automatically
  4. Error is shown asking to first drop the indexes
Answer : A

 

18) How to change the column data type in Hive

  1. ALTER and CHANGE
  2. ALTER
  3. CHANGE
  4. None
Answer : A

 

19) Are multiline comments supported in Hive?

  1. Yes
  2. No
  3. None
  4. None
Answer : B

 

20) Which of the following operator executes a shell command from the Hive shell?

  1. |
  2. !
  3. ^
  4. +
Answer : B

 

21) The results of a hive query can be stored as

  1. Local File
  2. HDFS file
  3. Both the above
  4. Cannot be stored
Answer : C

 

22) If the database contains some tables then it can be forced to drop without dropping the tables by using the keyword

  1. RESTRICT
  2. OVERWRITE
  3. F DROP
  4. CASCADE
Answer : D

 

23) Users can pass configuration information to the SerDe using

  1. SET SERDEPRPERTIES
  2. WITH SERDEPRPERTIES
  3. BY SERDEPRPERTIES
  4. CONFIG SERDEPRPERTIES
Answer : B

 

24) The property set to run hive in local mode as true so that it runs without creating a mapreduce job is

  1. hive.exec.mode.local.auto
  2. exec.mode.local.override
  3. exec.mode.local.settings
  4. exec.mode.local.config
Answer : A

 

25) Which kind of keys (CONSTRAINTS) Hive can have?

  1. Primary Keys
  2. Foreign Keys
  3. Unique Keys
  4. None of the above
Answer : D

 

26) What is the disadvantage of using too many partitions in Hive tables?

  1. It slows down the namenode
  2. Storage space is wasted
  3. Join quires become slow
  4. All of the above
Answer : D

 

27) The default delimiter in hive to separate the element in STRUCT is

  1. \001′
  2. ‘\002’
  3. ‘\003’
  4. \004′
Answer : B

 

28) By default when a database is dropped in Hive

  1. The tables are also deleted
  2. The directory is deleted if there are no tables
  3. The HDFS blocks are formatted
  4. None of the above
Answer : B

 

29) The main advantage of creating table partition is

  1. Effective storage memory utilization
  2. Faster query performance
  3. Less RAM required by namenode
  4. Simpler query syntax
Answer : B

 

30) If the schema of the table does not match with the data types present in the file containing the table then Hive

  1. Automatically drops the file
  2. Automatically corrects the data
  3. Reports Null values for mismatched data
  4. Does not allow any query to run on the table
Answer : C

 

31) A view in Hive can be seen by using

  1. SHOW TABLES
  2. SHOW VIEWS
  3. DESCRIBE VIEWS
  4. VIEW VIEWS
Answer : A

 

32) What Hive cannot offer

  1. Storing data in tables and columns
  2. Online transaction processing
  3. Handling date time data
  4. Partitioning stored data
Answer : B

 

33) To see the partitions keys present in a Hive table the command used is

  1. Describe
  2. Describe extended
  3. Show
  4. Show extended
Answer : A

 

34) The below expression in the where clause RLIKE ‘.*(Chicago|Ontario).*’; gives the result which match

  1. words containing both Chicago and Ontario
  2. words containing either Chicago or Ontario
  3. words Ending with Chicago or Ontario
  4. words starting with Chicago or Ontario
Answer : B

 

35) What will be the output of cast (‘XYZ’ as INT)?

  1. XYZ
  2. 123
  3. NULL
  4. Error
Answer : C

 

36) Which function will give output “hiveisgood”

  1. LOWER(TRIM(‘ HIVEISGOOD ’))
  2. LTRIM(‘ HIVEISGOOD ’)
  3. TRIM(‘ hiveisgood ’)
  4. a and c
Answer : D

 

37) On dropping an external table

  1. The schema gets dropped without dropping the data
  2. The data gets dropped without dropping the schema
  3. An error is thrown
  4. Both the schema and the data is dropped
Answer : B

 

38) If we change the partition location of a hive table using ALTER TABLE option then the data for that partition in the table

  1. also moves automatically to the new location
  2. has to be dropped and recreated
  3. has to be backed up into a second table and restored
  4. has to be moved manually into new location
Answer : D

 

39) EMPLOYEE table has (empid , empname, salary, deptid) Which below query will return employee with highest salary, Output- empname,salary?

  1. SELECT empid,max(salary) from EMPLOYEE;
  2. SELECT empname,max(salary) from EMPLOYEE;
  3. SELECT empname,max(salary) from EMPLOYEE group by empname;
  4. NONE
Answer : C

 

40) 1.    EMPLOYEE table has (empid string, empname, salary, deptname) Which query will return employee with 3rd highest salary with Department name?

  1. select dept_name, empname, sal  from (select  dept_name ,empname,sal,dense_rank() over (partition by empname order by salalry desc) r from employee) where r =3
  2. select dept_name, empname, sal  from (select  dept_name ,empname,sal sort (partition by deptname) r from employee) where dense_rank() =3;
  3. select dept_name, empname, sal  from (select  dept_name ,empname,sal,dense_rank() over (partition by deptname order by salalry desc) r from employee) where r =3
  4. NONE
Answer : C

 

41) OLYMPIC TABLE (AthleteName,Age,Country,Year,Closing Date,Sport,Gold Medals,Silver Medals,Bronze Medals,Total Medals)

  1. SELECT country, year, SUM(total medals) FROM OLYMPIC group by country, year ;
  2. SELECT country, year, SUM(total medals) FROM OLYMPIC where sport=’Shooting’;
  3. SELECT country, year, SUM(total medals) FROM OLYMPIC where sport=’Shooting’ group by country, year ;
  4. NONE
Answer : C

 

42) Which of following CASE statement is correct in hive?

  1. SELECT tutorial_id, tutorial_name
  2. SELECT tutorial_id, tutorial_name
  3. SELECT tutorial_id, tutorial_name
  4. SELECT tutorial_id, tutorial_name
Answer : B

 

)

  1. CASE
  2. CASE
  3. CASE
  4. CASE WHEN tutorial_name = ‘SQL’ THEN ‘SQL is developed by IBM’
Answer :

 

)

  1. WHEN tutorial_name = ‘SQL’ THEN ‘SQL is developed by IBM’
  2. WHEN tutorial_name = ‘SQL’ THEN ‘SQL is developed by IBM’
  3. WHEN tutorial_name = ‘SQL’ THEN ‘SQL is developed by IBM’
  4. CASE WHEN tutorial_name = ‘PL SQL’ THEN ‘SQL is developed by Oracle’
Answer :

 

)

  1. WHEN tutorial_name = ‘PL SQL’ THEN ‘SQL is developed by Oracle’
  2. WHEN tutorial_name = ‘PL SQL’ THEN ‘SQL is developed by Oracle’
  3. tutorial_name = ‘PL SQL’ THEN ‘SQL is developed by Oracle’
  4. CASE WHEN tutorial_name = ‘MS SQL’ THEN ‘SQL is developed by Microsoft’
Answer :

 

)

  1. WHEN tutorial_name = ‘MS SQL’ THEN ‘SQL is developed by Microsoft’
  2. WHEN tutorial_name = ‘MS SQL’ THEN ‘SQL is developed by Microsoft’
  3. tutorial_name = ‘MS SQL’ THEN ‘SQL is developed by Microsoft’
  4. END AS description
Answer :

 

)

  1. END AS description
  2. END AS description
  3. END AS description
  4. FROM tutorial
Answer :

 

)

  1. FROM tutorial
  2. FROM tutorial
  3. FROM tutorial
Answer :

 

43) Which command(s) is/are used to get help about a command in Linux?

  1. info
  2. man
  3. None of these
  4. A&B
Answer : D

 

44) Which command is used to get the kernel version in Linux?

  1. uname -r
  2. uname -s
  3. uname -n
  4. kernal
Answer : A

 

45) Which command is used to list all the files in your current directory(including hidden)?

  1. ls -l
  2. ls -al
  3. ls -h
  4. ls -t
Answer : B

 

46) Which of the following command is used to create file in Linux?

  1. touch
  2. echo
  3. cat
  4. All of Above
Answer : D

 

47) In Linux everything stored as a

  1. Directory
  2. executables
  3. File
  4. None of these
Answer : C

 

48) The tables created in hive are stored as

  1. A file under the database directory
  2. A subdirectory under the database directory
  3. A .java file present in the database directory
  4. A HDFS block containing the database directory
Answer : B

 

49) If the database contains some tables then it can be forced to drop without dropping the tables by using the keyword

  1. RESTRICT
  2. OVERWRITE
  3. F DROP
  4. CASCADE
Answer : D

 

50) Users can pass configuration information to the SerDe using

  1. SET SERDEPRPERTIES
  2. WITH SERDEPRPERTIES
  3. BY SERDEPRPERTIES
  4. CONFIG SERDEPRPERTIES
Answer : B

 

51) The property set to run hive in local mode as true so that it runs without creating a mapreduce job is

  1. exec.mode.local.auto
  2. exec.mode.local.override
  3. exec.mode.local.settings
  4. exec.mode.local.config
Answer : A

 

52) Which kind of keys(CONSTRAINTS) Hive can have?

  1. Primary Keys
  2. Foreign Keys
  3. Unique Keys
  4. None of the above
Answer : D

 

53) What is the disadvantage of using too many partitions in Hive tables?

  1. It slows down the namenode
  2. Storage space is wasted
  3. Join quires become slow
  4. All of the above
Answer : D

 

54) The default delimiter in hive to separate the element in STRUCT is

  1. ‘\001’
  2. ‘\oo2’
  3. ‘\oo3’
  4. ‘\oo4’
Answer : B

 

55) By default when a database is dropped in Hive

  1. The tables are also deleted
  2. The directory is deleted if there are no tables
  3. The HDFS blocks are formatted
  4. None of the above
Answer : B

 

56) The main advantage of creating table partition is

  1. Effective storage memory utilization
  2. Faster query performance
  3. Less RAM required by namenode
  4. Simpler query syntax
Answer : B

 

57) If the schema of the table does not match with the data types present in the file containing the table then Hive

  1. Automatically drops the file
  2. Automatically corrects the data
  3. Reports Null values for mismatched data.Does not allow any query to run on the table
Answer : C

 

58) A view in Hive can be seen by using

  1. SHOW TABLES
  2. SHOW VIEWS
  3. DESCRIBE VIEWS
  4. VIEW VIEWS
Answer : A

 

59) If an Index is dropped then

  1. The underlying table is also dropped
  2. The directory containing the index is deleted
  3. The underlying table is not dropped
  4. Error is thrown by hive
Answer : D

 

60) Which file controls the logging of Mapreduce Tasks?

  1. hive-log4j.properties
  2. hive-exec-log4j.properties
  3. hive-cli-log4j.properties
  4. hive-create-log4j.properties
Answer : B

 

61) What Hive can not offer

  1. Storing data in tables and columns
  2. Online transaction processing
  3. Handling date time data
  4. Partitioning stored data
Answer : B

 

62) To see the partitions keys present in a Hive table the command used is

  1. Describe
  2. Describe extended
  3. Show
  4. Show extended
Answer : B