Complete the code to enable vectorized query execution in Hive.
SET hive.vectorized.execution.enabled=[1];Setting hive.vectorized.execution.enabled to true enables vectorized query execution, which improves performance by processing batches of rows.
Complete the code to enable cost-based optimization in Hive.
SET hive.cbo.enable=[1];Setting hive.cbo.enable to true turns on cost-based optimization, which helps Hive choose efficient query plans.
Fix the error in the query to enable dynamic partition pruning.
SET hive.optimize.ppd=[1];The correct value to enable dynamic partition pruning is true. Other values cause errors or are invalid.
Fill both blanks to create a query that uses a map join and disables auto conversion.
SET hive.auto.convert.join=[1]; SELECT /*+ MAPJOIN([2]) */ * FROM sales JOIN customers ON sales.customer_id = customers.id;
Setting hive.auto.convert.join to false disables automatic join conversion. The hint MAPJOIN(customers) forces a map join on the customers table.
Fill all three blanks to create a query that collects statistics for optimization.
ANALYZE TABLE [1] COMPUTE STATISTICS FOR COLUMNS [2] [3];
This command collects column statistics with histograms on the 'customer_id' column of the 'sales' table, helping Hive optimize queries.