Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
Which software framework is commonly required for installing and running Apache Hive?
Not quite. Try another option.
Answer: Apache Hadoop
Apache Hive commonly runs with Hadoop and uses Hadoop storage and processing components.
Question 2 of 60 · Hive installation · Easy
Which environment variable usually points to the Apache Hive installation directory?
Not quite. Try another option.
Answer: HIVE_HOME
HIVE_HOME stores the path to the directory where Apache Hive is installed.
Question 3 of 60 · Hive installation · Easy
Which file is commonly used to configure Apache Hive settings?
Not quite. Try another option.
Answer: hive-site.xml
hive-site.xml contains configuration properties used by Apache Hive.
Question 4 of 60 · Hive data types · Easy
Which Hive data type is used to store whole numbers?
Not quite. Try another option.
Answer: INT
INT is used to store whole numbers without a fractional part.
Question 5 of 60 · Hive data types · Easy
Which Hive data type is used to store text?
Not quite. Try another option.
Answer: STRING
STRING is used to store sequences of characters or text.
Question 6 of 60 · Hive data types · Easy
Which of the following is a complex data type in Hive?
Not quite. Try another option.
Answer: ARRAY
ARRAY is a complex type that stores an ordered collection of values.
Question 7 of 60 · Hive bucketing · Easy
What does Hive bucketing primarily do?
Not quite. Try another option.
Answer: Distributes rows into files
Bucketing distributes rows into a fixed number of files, usually using a hash of a column.
Question 8 of 60 · Hive bucketing · Easy
Which clause is used to define bucket columns in a Hive table?
Not quite. Try another option.
Answer: CLUSTERED BY
CLUSTERED BY specifies the columns used to distribute table rows into buckets.
Question 9 of 60 · Hive bucketing · Easy
Which phrase specifies the number of buckets in a Hive table definition?
Not quite. Try another option.
Answer: INTO 4 BUCKETS
The INTO 4 BUCKETS phrase sets the table's bucket count to four.
Question 10 of 60 · Hive partitioning · Easy
What is the main purpose of partitioning a Hive table?
Not quite. Try another option.
Answer: To divide data by column values
Partitioning organizes data into separate directories based on selected column values.
Question 11 of 60 · Hive partitioning · Easy
Which clause is used to define partition columns in Hive?
Not quite. Try another option.
Answer: PARTITIONED BY
PARTITIONED BY declares the columns used to partition a Hive table.
Question 12 of 60 · Hive partitioning · Easy
What is partition pruning in Hive?
Not quite. Try another option.
Answer: Reading only relevant partitions
Partition pruning avoids scanning partitions that do not match the query filter.
Question 13 of 60 · HiveQL operations · Easy
Which HiveQL statement creates a new table?
Not quite. Try another option.
Answer: CREATE TABLE
CREATE TABLE defines a new table and its columns in Hive.
Question 14 of 60 · HiveQL operations · Easy
Which HiveQL statement retrieves data from a table?
Not quite. Try another option.
Answer: SELECT
SELECT retrieves specified columns and rows from a Hive table.
Question 15 of 60 · HiveQL operations · Easy
Which HiveQL statement adds query results to an existing table?
Not quite. Try another option.
Answer: INSERT INTO
INSERT INTO appends query results to the existing data in a table.
Question 16 of 60 · HiveQL operations · Easy
Which HiveQL statement removes both a table definition and its managed data?
Not quite. Try another option.
Answer: DROP TABLE
DROP TABLE removes the table definition and, for a managed table, its stored data.
Question 17 of 60 · Hive operators · Easy
Which operator tests whether two values are equal in HiveQL?
Not quite. Try another option.
Answer: =
The = comparison operator checks whether two values are equal.
Question 18 of 60 · Hive operators · Easy
Which logical operator requires both conditions to be true?
Not quite. Try another option.
Answer: AND
The AND operator returns true only when both connected conditions are true.
Question 19 of 60 · Hive operators · Easy
Which arithmetic operator is used for addition in HiveQL?
Not quite. Try another option.
Answer: +
The + operator adds one numeric value to another.
Question 20 of 60 · Hive operators · Easy
In a HiveQL LIKE pattern, which symbol represents any sequence of characters?
Not quite. Try another option.
Answer: %
The % wildcard in a LIKE pattern matches zero or more characters.
Question 21 of 60 · Hive installation · Medium
After installing Hive with an external MySQL metastore, Hive fails because the metastore tables do not exist. Which command should be run before starting Hive?
Not quite. Try another option.
Answer: schematool -dbType mysql -initSchema
schematool initializes the Hive metastore schema in the configured relational database.
Question 22 of 60 · Hive installation · Medium
A team uses Hive's default embedded Derby metastore. Why might two developers be unable to run separate Hive sessions simultaneously from the same installation directory?
Not quite. Try another option.
Answer: Embedded Derby generally permits only one active process
The embedded Derby metastore is intended for simple local use and generally allows only one active process at a time.
Question 23 of 60 · Hive installation · Medium
Hive is installed successfully, but creating a managed table fails because Hive cannot write to its warehouse directory in HDFS. Which action most directly addresses the problem?
Not quite. Try another option.
Answer: Grant Hive write permission on the warehouse directory
Hive must have appropriate HDFS permissions to create and manage files under its warehouse directory.
Question 24 of 60 · Hive data types · Medium
A table stores a variable-length list of product identifiers for each order. Which Hive data type is most appropriate for the product_ids column?
Not quite. Try another option.
Answer: ARRAY<STRING>
ARRAY<STRING> represents an ordered collection of product identifiers whose length may vary by row.
Question 25 of 60 · Hive data types · Medium
A customer column must contain name, email, and age as named fields within a single value. Which declaration best represents this requirement?
Not quite. Try another option.
Answer: STRUCT<name:STRING,email:STRING,age:INT>
A STRUCT groups related values into one column and gives each nested field a name and data type.
Question 26 of 60 · Hive data types · Medium
A financial table must store monetary amounts with exactly two fractional digits and up to ten total digits. Which Hive type is the best choice?
Not quite. Try another option.
Answer: DECIMAL(10,2)
DECIMAL(10,2) stores up to ten digits in total, with exactly two positions reserved for the fractional part.
Question 27 of 60 · Hive bucketing · Medium
A table is declared with CLUSTERED BY (customer_id) INTO 16 BUCKETS. How is a row normally assigned to a bucket?
Not quite. Try another option.
Answer: Using a hash of customer_id modulo 16
Hive applies a hash function to the bucketing column and uses the bucket count to determine the destination bucket.
Question 28 of 60 · Hive bucketing · Medium
Two large tables are bucketed on customer_id using compatible bucket counts and bucketing rules. Which workload is most likely to benefit?
Not quite. Try another option.
Answer: A join between the tables on customer_id
Compatible bucketing on the join key can reduce data movement and enable optimized bucket-based joins.
Question 29 of 60 · Hive bucketing · Medium
A bucketed table contains 32 buckets. An analyst needs a repeatable sample based on the bucketing column. Which clause is designed for this purpose?
Not quite. Try another option.
Answer: TABLESAMPLE(BUCKET 1 OUT OF 8 ON customer_id)
TABLESAMPLE can select deterministic bucket-based samples when used with an appropriate bucketing column.
Question 30 of 60 · Hive bucketing · Medium
A table is declared as bucketed into eight buckets, but data files are copied directly into its directory without applying the bucketing logic. What is the main consequence?
Not quite. Try another option.
Answer: Bucket-based optimizations may produce unreliable behavior
The table declaration alone does not reorganize copied data; rows must be written using the expected bucketing rules.
Question 31 of 60 · Hive partitioning · Medium
A sales table is partitioned by sale_date. Which query is most likely to benefit from partition pruning?
Not quite. Try another option.
Answer: SELECT * FROM sales WHERE sale_date = '2025-01-15'
Filtering directly on the partition column lets Hive skip partitions whose sale_date does not match.
Question 32 of 60 · Hive partitioning · Medium
Data for a new static partition must be loaded into a table partitioned by year and month. Which statement correctly targets March 2025?
Not quite. Try another option.
Answer: LOAD DATA INPATH '/data/march' INTO TABLE sales PARTITION(year=2025, month=3)
The PARTITION clause after the table name identifies the static partition that will receive the data.
Question 33 of 60 · Hive partitioning · Medium
A table is partitioned by the exact event_timestamp, producing thousands of tiny partitions each day. Which redesign is generally more practical?
Not quite. Try another option.
Answer: Partition by derived date and retain the timestamp as a column
A lower-cardinality date partition supports pruning without creating an excessive number of small partitions.
Question 34 of 60 · Hive partitioning · Medium
Partition directories already exist in HDFS, but their metadata was not added to the Hive metastore. Which command can discover and register them?
Not quite. Try another option.
Answer: MSCK REPAIR TABLE sales
MSCK REPAIR TABLE scans partition-style directories and adds missing partition metadata to the metastore.
Question 35 of 60 · HiveQL operations · Medium
A query must return each department and its average salary, but only for departments whose average exceeds 60000. Which clause should contain the aggregate condition?
Not quite. Try another option.
Answer: HAVING AVG(salary) > 60000
HAVING filters grouped results after aggregate functions such as AVG have been calculated.
Question 36 of 60 · HiveQL operations · Medium
A query needs a globally ordered result by total_sales across all output rows. Which HiveQL clause should be used?
Not quite. Try another option.
Answer: ORDER BY total_sales
ORDER BY provides global ordering of the final result, while SORT BY orders rows only within each reducer.
Question 37 of 60 · HiveQL operations · Medium
A developer wants to replace the existing data in a target table with the result of a query. Which HiveQL form is appropriate?
Not quite. Try another option.
Answer: INSERT OVERWRITE TABLE target SELECT * FROM source
INSERT OVERWRITE replaces the existing table or partition data with the query result.
Question 38 of 60 · Hive operators · Medium
Which condition selects employees whose salary is between 40000 and 60000, including both boundary values?
Not quite. Try another option.
Answer: salary BETWEEN 40000 AND 60000
BETWEEN is inclusive, so salaries equal to 40000 or 60000 are included.
Question 39 of 60 · Hive operators · Medium
A query must find rows where middle_name has no value. Which predicate correctly handles Hive's null semantics?
Not quite. Try another option.
Answer: middle_name IS NULL
Null values must be tested with IS NULL; ordinary equality comparisons with NULL do not evaluate to true.
Question 40 of 60 · Hive operators · Medium
A tags column has type ARRAY<STRING>. Which expression accesses the first tag in the array?
Not quite. Try another option.
Answer: tags[0]
Hive arrays use zero-based indexing, so index 0 retrieves the first element.
Question 41 of 60 · Hive installation · Hard
A development team starts HiveServer2 with the default embedded Derby metastore. The first session works, but a second concurrent Hive process fails to access metadata. What is the most appropriate production fix?
Not quite. Try another option.
Answer: Configure a standalone relational database and run the Hive metastore as a service
Embedded Derby normally permits only one process to access the metastore database. A production deployment should use a supported external RDBMS with a standalone metastore service.
Question 42 of 60 · Hive installation · Hard
HiveServer2 must use a remote metastore available at thrift://meta1:9083. Which client-side setting establishes this connection?
Not quite. Try another option.
Answer: Set hive.metastore.uris to thrift://meta1:9083
hive.metastore.uris tells Hive clients where the remote Thrift metastore runs. The JDBC connection properties belong to the metastore service itself.
Question 43 of 60 · Hive installation · Hard
After upgrading Hive binaries, startup reports that the PostgreSQL metastore schema version is older than the Hive software version. Assuming the database is backed up, which action directly addresses the mismatch?
Not quite. Try another option.
Answer: Run schematool -dbType postgres -upgradeSchema
-upgradeSchema applies the metastore migrations required by the newer Hive release. -initSchema is intended for initializing a new schema.
Question 44 of 60 · Hive installation · Hard
HiveServer2 can connect to the metastore, but queries fail with permission errors while creating managed tables under /user/hive/warehouse. Which installation issue is most directly implicated?
Not quite. Try another option.
Answer: The Hive service identity lacks suitable HDFS permissions on the warehouse path
The metastore stores metadata, while table directories are created in the filesystem. The effective Hive identity therefore needs appropriate HDFS permissions on the warehouse location.
Question 45 of 60 · Hive data types · Hard
A value stored as DECIMAL(5,2) is rounded from 999.995 to two fractional digits. What is the smallest decimal type that can represent the rounded result without overflow?
Not quite. Try another option.
Answer: DECIMAL(6,2)
Rounding produces 1000.00, which has four integer digits and two fractional digits. It therefore requires precision and scale .
Question 46 of 60 · Hive data types · Hard
Two columns contain CHAR(5) value ab and VARCHAR(5) value ab , respectively. Which statement correctly describes Hive's trailing-space semantics?
CHAR has fixed-length, space-padded semantics in which trailing spaces are insignificant for comparison. VARCHAR preserves trailing spaces as part of the value.
Question 47 of 60 · Hive data types · Hard
Given a ARRAY<INT> and m MAP<STRING,INT>, what does Hive return for a[0] and m['missing'] when a = array(7,8) and the map has no missing key?
Not quite. Try another option.
Answer: 7 and NULL
Hive arrays use zero-based indexing, so a[0] is 7. Looking up a key that is absent from a map produces NULL.
Question 48 of 60 · Hive data types · Hard
For a column declared UNIONTYPE<INT,STRING,DOUBLE>, which expression constructs the string alternative containing high?
Not quite. Try another option.
Answer: create_union(1, 'high')
UNIONTYPE alternatives have zero-based tags. The STRING member is the second alternative, so its tag is 1.
Question 49 of 60 · Hive bucketing · Hard
A table is declared CLUSTERED BY (customer_id) INTO 32 BUCKETS, but existing files were copied into its directory without being written by a bucketing-aware Hive operation. Which conclusion is valid?
Not quite. Try another option.
Answer: The metadata alone does not guarantee that rows are physically assigned to correct buckets
A bucket declaration describes the expected physical organization. Arbitrarily copied files are not automatically reorganized, even if their count matches the declared bucket count.
Question 50 of 60 · Hive bucketing · Hard
Table L has 8 buckets on id, and table R has 24 buckets on id. Ignoring other optimizer constraints, which property supports a bucket map join on L.id = R.id?
Not quite. Try another option.
Answer: One bucket count is an integer multiple of the other
Bucket map joins can align bucket groups when both tables use the join key and one bucket count is a multiple of the other. Here, .
Question 51 of 60 · Hive bucketing · Hard
Assume an integer bucket key uses bucket number (hash(key) & 0x7fffffff) % 4, with hash(key) = key. Into which bucket is key -3 placed?
Not quite. Try another option.
Answer: Bucket 1
-3 & 0x7fffffff equals 2147483645, and . The mask converts the hash to a nonnegative value before the modulo operation.
Question 52 of 60 · Hive partitioning · Hard
A table is partitioned by (dt STRING, region STRING). For INSERT ... PARTITION (dt, region) with both partitions dynamic, how must the source projection be arranged?
Not quite. Try another option.
Answer: The dt and region values must be the final columns in that partition-key order
Dynamic partition values are supplied as the last projected columns and must follow the order of the partition columns declared in the target table.
Question 53 of 60 · Hive partitioning · Hard
With hive.exec.dynamic.partition.mode=strict, which insertion into a table partitioned by (dt, country) is permitted?
Not quite. Try another option.
Answer: PARTITION (dt='2025-01-01', country) with country selected dynamically
Strict mode requires at least one static partition column. Fixing dt statically satisfies that requirement while allowing country to remain dynamic.
Question 54 of 60 · Hive partitioning · Hard
A table is partitioned by string column dt in ISO format. A query filters with year(to_date(dt)) = 2025, but the optimizer cannot infer a direct partition constraint from that function. Which rewrite most directly enables partition pruning for 2025?
Not quite. Try another option.
Answer: dt >= '2025-01-01' AND dt < '2026-01-01'
Direct bounds on the partition column expose the relevant partition range to pruning. Wrapping the partition key in functions can prevent compile-time partition elimination.
Question 55 of 60 · HiveQL operations · Hard
A source table feeds three aggregate tables with different filters. Which HiveQL structure is designed to express the work while sharing a single source scan?
Not quite. Try another option.
Answer: A multi-table insert using one FROM clause and three INSERT branches
Hive's multi-table insert syntax places the source in one FROM clause and routes rows through multiple INSERT branches, allowing the input scan to be shared.
Question 56 of 60 · HiveQL operations · Hard
A query must retain every row from customers, including customers with no qualifying order. Which placement of o.status = 'PAID' preserves that requirement?
Not quite. Try another option.
Answer: Place it in the ON clause of the LEFT OUTER JOIN
Filtering the right table in ON still permits an unmatched, null-extended row. Applying the predicate in WHERE removes that row and effectively turns the result into an inner join for the condition.
Question 57 of 60 · HiveQL operations · Hard
A partitioned table contains data for many dates. What is the effect of INSERT OVERWRITE TABLE sales PARTITION (dt='2025-03-01') SELECT ...?
Not quite. Try another option.
Answer: It replaces only the specified partition's data
Because the overwrite targets a specific static partition, Hive replaces data in that partition. Other partitions are not overwritten.
Question 58 of 60 · Hive operators · Hard
For nullable columns a and b, which predicate evaluates to TRUE when both values are NULL and to FALSE when exactly one is NULL?
Not quite. Try another option.
Answer: a <=> b
<=> is Hive's null-safe equality operator. It treats two nulls as equal and returns a definite Boolean result when only one operand is null.
Question 59 of 60 · Hive operators · Hard
For a non-null value x = 1, a subquery used by x NOT IN (...) returns the set {2, NULL}. Under SQL three-valued logic, what is the predicate's result?
Not quite. Try another option.
Answer: UNKNOWN, so a WHERE clause filters the row out
1 <> 2 is true, but 1 <> NULL is unknown; their conjunction is unknown. A WHERE clause retains only rows for which the predicate is true.
Question 60 of 60 · Hive operators · Hard
Given Boolean values a = TRUE, b = FALSE, and c = FALSE, what is the result of a OR b AND c under Hive operator precedence?
Not quite. Try another option.
Answer: TRUE, because AND is evaluated before OR
AND has higher precedence than OR, so the expression is a OR (b AND c). This becomes TRUE OR FALSE, which is TRUE.
That's unit 4
Answer a few questions and your score shows up here.
Nearly through. Did unit 4 of INT312 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 4 of INT312 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.