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?
- MapReduce
- HDFS
- YARN
- All of these
2) What is the default HDFS block size?
- 32 MB
- 64 KB
- 128 KB
- 64 MB
3) Which of the following type of joins can be performed in Reduce side join operation?
- Equi Join
- Left Outer Join
- Right Outer Join
- All of the above
4) A Map reduce job can be written in:
- Java
- Ruby
- Python
- Any Language which can read from input stream
5) Which of the following are not possible in Hive?
- Creating Tables
- Creating Synonym
- Writing Update Statements
- Both (b) and (c)
6) Who will initiate the mapper?
- Task tracker
- Job tracker
- Combiner
- Reducer
7) Which of the following is not true about Name Node? (Select multiple answer)
- It is the Master Machine of the Cluster
- It is Name Node that can store user data
- Name Node is a storage heavy machine
- Name Node can be replaced by any Data Node Machine
8) Which of the following is true for Hive?
- Hive is the database of Hadoop
- Hive supports schema checking
- Hive doesn’t allow row level updates
- Hive can replace an OLTP system
9) Partitioned tables in Hive:
- Are aimed to increase the performance of the queries
- Modify the underlying HDFS structure
- Are not useful if the filter columns for query are different from the partition columns
- All of the above
10) HBase first reads the data from
- Block Cache
- Memstore
- HFile
- WAL
11) The partitioned columns in Hive tables are
- Physically present and can be accessed
- Physically absent but can be accessed
- Physically present but can’t be accessed
- Physically absent and can’t be accessed
12) What is the disadvantage of using too many partitions in Hive tables?
- It slows down the namenode
- Storage space is wasted
- Join quires become slow
- All of the above
13) The main advantage of creating table partition is
- Effective storage memory utilization
- Faster query performance
- Less RAM required by namenode
- Simpler query syntax
14) Which file controls the logging of Mapreduce Tasks?
- hive-log4j.properties
- hive-exec-log4j.properties
- hive-cli-log4j.properties
- hive-create-log4j.properties
15) The tables created in hive are stored as
- A file under the database directory
- A subdirectory under the database directory
- A .java file present in the database directory
- A HDFS block containing the database directory
16) On dropping a external table
- The schema gets dropped without dropping the data
- An error is thrown
- Both the schema and the data is dropped
17) The partition of an Indexed table is dropped. then,
- Corresponding partition from all indexes are dropped.
- No indexes are dropped
- Indexes refresh themselves automatically
- Error is shown asking to first drop the indexes
18) How to change the column data type in Hive
- ALTER and CHANGE
- ALTER
- CHANGE
- None
19) Are multiline comments supported in Hive?
- Yes
- No
- None
- None
20) Which of the following operator executes a shell command from the Hive shell?
- |
- !
- ^
- +
21) The results of a hive query can be stored as
- Local File
- HDFS file
- Both the above
- Cannot be stored
22) If the database contains some tables then it can be forced to drop without dropping the tables by using the keyword
- RESTRICT
- OVERWRITE
- F DROP
- CASCADE
23) Users can pass configuration information to the SerDe using
- SET SERDEPRPERTIES
- WITH SERDEPRPERTIES
- BY SERDEPRPERTIES
- CONFIG SERDEPRPERTIES
24) The property set to run hive in local mode as true so that it runs without creating a mapreduce job is
- hive.exec.mode.local.auto
- exec.mode.local.override
- exec.mode.local.settings
- exec.mode.local.config
25) Which kind of keys (CONSTRAINTS) Hive can have?
- Primary Keys
- Foreign Keys
- Unique Keys
- None of the above
26) What is the disadvantage of using too many partitions in Hive tables?
- It slows down the namenode
- Storage space is wasted
- Join quires become slow
- All of the above
27) The default delimiter in hive to separate the element in STRUCT is
- \001′
- ‘\002’
- ‘\003’
- \004′
28) By default when a database is dropped in Hive
- The tables are also deleted
- The directory is deleted if there are no tables
- The HDFS blocks are formatted
- None of the above
29) The main advantage of creating table partition is
- Effective storage memory utilization
- Faster query performance
- Less RAM required by namenode
- Simpler query syntax
30) If the schema of the table does not match with the data types present in the file containing the table then Hive
- Automatically drops the file
- Automatically corrects the data
- Reports Null values for mismatched data
- Does not allow any query to run on the table
31) A view in Hive can be seen by using
- SHOW TABLES
- SHOW VIEWS
- DESCRIBE VIEWS
- VIEW VIEWS
32) What Hive cannot offer
- Storing data in tables and columns
- Online transaction processing
- Handling date time data
- Partitioning stored data
33) To see the partitions keys present in a Hive table the command used is
- Describe
- Describe extended
- Show
- Show extended
34) The below expression in the where clause RLIKE ‘.*(Chicago|Ontario).*’; gives the result which match
- words containing both Chicago and Ontario
- words containing either Chicago or Ontario
- words Ending with Chicago or Ontario
- words starting with Chicago or Ontario
35) What will be the output of cast (‘XYZ’ as INT)?
- XYZ
- 123
- NULL
- Error
36) Which function will give output “hiveisgood”
- LOWER(TRIM(‘ HIVEISGOOD ’))
- LTRIM(‘ HIVEISGOOD ’)
- TRIM(‘ hiveisgood ’)
- a and c
37) On dropping an external table
- The schema gets dropped without dropping the data
- The data gets dropped without dropping the schema
- An error is thrown
- Both the schema and the data is dropped
38) If we change the partition location of a hive table using ALTER TABLE option then the data for that partition in the table
- also moves automatically to the new location
- has to be dropped and recreated
- has to be backed up into a second table and restored
- has to be moved manually into new location
39) EMPLOYEE table has (empid , empname, salary, deptid) Which below query will return employee with highest salary, Output- empname,salary?
- SELECT empid,max(salary) from EMPLOYEE;
- SELECT empname,max(salary) from EMPLOYEE;
- SELECT empname,max(salary) from EMPLOYEE group by empname;
- NONE
40) 1. EMPLOYEE table has (empid string, empname, salary, deptname) Which query will return employee with 3rd highest salary with Department name?
- 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
- select dept_name, empname, sal from (select dept_name ,empname,sal sort (partition by deptname) r from employee) where dense_rank() =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
- NONE
41) OLYMPIC TABLE (AthleteName,Age,Country,Year,Closing Date,Sport,Gold Medals,Silver Medals,Bronze Medals,Total Medals)
- SELECT country, year, SUM(total medals) FROM OLYMPIC group by country, year ;
- SELECT country, year, SUM(total medals) FROM OLYMPIC where sport=’Shooting’;
- SELECT country, year, SUM(total medals) FROM OLYMPIC where sport=’Shooting’ group by country, year ;
- NONE
42) Which of following CASE statement is correct in hive?
- SELECT tutorial_id, tutorial_name
- SELECT tutorial_id, tutorial_name
- SELECT tutorial_id, tutorial_name
- SELECT tutorial_id, tutorial_name
)
- CASE
- CASE
- CASE
- CASE WHEN tutorial_name = ‘SQL’ THEN ‘SQL is developed by IBM’
)
- WHEN tutorial_name = ‘SQL’ THEN ‘SQL is developed by IBM’
- WHEN tutorial_name = ‘SQL’ THEN ‘SQL is developed by IBM’
- WHEN tutorial_name = ‘SQL’ THEN ‘SQL is developed by IBM’
- CASE WHEN tutorial_name = ‘PL SQL’ THEN ‘SQL is developed by Oracle’
)
- WHEN tutorial_name = ‘PL SQL’ THEN ‘SQL is developed by Oracle’
- WHEN tutorial_name = ‘PL SQL’ THEN ‘SQL is developed by Oracle’
- tutorial_name = ‘PL SQL’ THEN ‘SQL is developed by Oracle’
- CASE WHEN tutorial_name = ‘MS SQL’ THEN ‘SQL is developed by Microsoft’
)
- WHEN tutorial_name = ‘MS SQL’ THEN ‘SQL is developed by Microsoft’
- WHEN tutorial_name = ‘MS SQL’ THEN ‘SQL is developed by Microsoft’
- tutorial_name = ‘MS SQL’ THEN ‘SQL is developed by Microsoft’
- END AS description
)
- END AS description
- END AS description
- END AS description
- FROM tutorial
)
- FROM tutorial
- FROM tutorial
- FROM tutorial
43) Which command(s) is/are used to get help about a command in Linux?
- info
- man
- None of these
- A&B
44) Which command is used to get the kernel version in Linux?
- uname -r
- uname -s
- uname -n
- kernal
45) Which command is used to list all the files in your current directory(including hidden)?
- ls -l
- ls -al
- ls -h
- ls -t
46) Which of the following command is used to create file in Linux?
- touch
- echo
- cat
- All of Above
47) In Linux everything stored as a
- Directory
- executables
- File
- None of these
48) The tables created in hive are stored as
- A file under the database directory
- A subdirectory under the database directory
- A .java file present in the database directory
- A HDFS block containing the database directory
49) If the database contains some tables then it can be forced to drop without dropping the tables by using the keyword
- RESTRICT
- OVERWRITE
- F DROP
- CASCADE
50) Users can pass configuration information to the SerDe using
- SET SERDEPRPERTIES
- WITH SERDEPRPERTIES
- BY SERDEPRPERTIES
- CONFIG SERDEPRPERTIES
51) The property set to run hive in local mode as true so that it runs without creating a mapreduce job is
- exec.mode.local.auto
- exec.mode.local.override
- exec.mode.local.settings
- exec.mode.local.config
52) Which kind of keys(CONSTRAINTS) Hive can have?
- Primary Keys
- Foreign Keys
- Unique Keys
- None of the above
53) What is the disadvantage of using too many partitions in Hive tables?
- It slows down the namenode
- Storage space is wasted
- Join quires become slow
- All of the above
54) The default delimiter in hive to separate the element in STRUCT is
- ‘\001’
- ‘\oo2’
- ‘\oo3’
- ‘\oo4’
55) By default when a database is dropped in Hive
- The tables are also deleted
- The directory is deleted if there are no tables
- The HDFS blocks are formatted
- None of the above
56) The main advantage of creating table partition is
- Effective storage memory utilization
- Faster query performance
- Less RAM required by namenode
- Simpler query syntax
57) If the schema of the table does not match with the data types present in the file containing the table then Hive
- Automatically drops the file
- Automatically corrects the data
- Reports Null values for mismatched data.Does not allow any query to run on the table
58) A view in Hive can be seen by using
- SHOW TABLES
- SHOW VIEWS
- DESCRIBE VIEWS
- VIEW VIEWS
59) If an Index is dropped then
- The underlying table is also dropped
- The directory containing the index is deleted
- The underlying table is not dropped
- Error is thrown by hive
60) Which file controls the logging of Mapreduce Tasks?
- hive-log4j.properties
- hive-exec-log4j.properties
- hive-cli-log4j.properties
- hive-create-log4j.properties
61) What Hive can not offer
- Storing data in tables and columns
- Online transaction processing
- Handling date time data
- Partitioning stored data
62) To see the partitions keys present in a Hive table the command used is
- Describe
- Describe extended
- Show
- Show extended