Override QueryExecution with special debug workflow.
Analyzes the given table in the current database to generate statistics, which will be used in query optimizations.
Analyzes the given table in the current database to generate statistics, which will be used in query optimizations.
Right now, it only supports Hive tables and it only updates the size of a Hive table in the Hive metastore.
Sets up the system initially or after a RESET command
Sets up the system initially or after a RESET command
Creates a table using the schema of the given class.
Creates a table using the schema of the given class.
A case class that is used to describe the schema of the table to be created.
The name of the table to create.
When false, an exception will be thrown if the table already exists.
The location of the hive source code.
The location of the compiled hive distribution
SQLConf and HiveConf contracts:
SQLConf and HiveConf contracts:
1. reuse existing started SessionState if any 2. when the Hive session is first initialized, params in HiveConf will get picked up by the SQLConf. Additionally, any properties set by set() or a SET command inside sql() will be set in the SQLConf *as well as* in the HiveConf.
Records the UDFs present when the server starts, so we can delete ones that are created by tests.
Records the UDFs present when the server starts, so we can delete ones that are created by tests.
Resets the test instance by deleting any tables that have been created.
Resets the test instance by deleting any tables that have been created. TODO: also clear out UDFs, views, etc.
Execute the command using Hive and return the results as a sequence.
Execute the command using Hive and return the results as a sequence. Each element in the sequence is one row.
Runs the specified SQL query using Hive.
Runs the specified SQL query using Hive.
SQLConf and HiveConf contracts:
SQLConf and HiveConf contracts:
1. reuse existing started SessionState if any 2. when the Hive session is first initialized, params in HiveConf will get picked up by the SQLConf. Additionally, any properties set by set() or a SET command inside sql() will be set in the SQLConf *as well as* in the HiveConf.
A list of test tables and the DDL required to initialize them.
A list of test tables and the DDL required to initialize them. A test table is loaded on demand when a query are run against it.
(Since version 1.1)
(Since version 1.1)
A locally running test instance of Spark's Hive execution engine.
Data from testTables will be automatically loaded whenever a query is run over those tables. Calling reset will delete all tables and other state in the database, leaving the database in a "clean" state.
TestHive is singleton object version of this class because instantiating multiple copies of the hive metastore seems to lead to weird non-deterministic failures. Therefore, the execution of test cases that rely on TestHive must be serialized.