public class HiveTestUtilities extends Object
| Constructor and Description |
|---|
HiveTestUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertNativeScanUsed(QueryBuilder queryBuilder,
String table)
Helper method used to ensure that native parquet scan will be used
for table selection.
|
static void |
assumeJavaVersion()
Checks if current version is supported by Hive.
|
static File |
createDirWithPosixPermissions(File parentDir,
String dirName)
Creates desired directory structure and
adds all posix permissions to created directory.
|
static void |
executeQuery(org.apache.hadoop.hive.ql.Driver hiveDriver,
String query)
Execute the give query on given hiveDriver instance.
|
static void |
insertData(org.apache.hadoop.hive.ql.Driver driver,
String srcTable,
String destTable)
Performs insert from select.
|
static boolean |
isHive3()
Checks whether current version is not less than hive 3.0
|
static void |
loadData(org.apache.hadoop.hive.ql.Driver driver,
String tableName,
Path relativeTestResourcePath)
Load data from test resources file into table.
|
static boolean |
supportedJavaVersion()
Current Hive version doesn't support JDK 9+.
|
public static void executeQuery(org.apache.hadoop.hive.ql.Driver hiveDriver,
String query)
public static File createDirWithPosixPermissions(File parentDir, String dirName)
parentDir - parent directorydirName - directory namepublic static void loadData(org.apache.hadoop.hive.ql.Driver driver,
String tableName,
Path relativeTestResourcePath)
driver - hive drivertableName - destinationrelativeTestResourcePath - path to test resourcepublic static void insertData(org.apache.hadoop.hive.ql.Driver driver,
String srcTable,
String destTable)
driver - hive driversrcTable - sourcedestTable - destinationpublic static void assertNativeScanUsed(QueryBuilder queryBuilder, String table) throws Exception
queryBuilder - test query buildertable - table to checkException - may be thrown while getting query planpublic static boolean supportedJavaVersion()
true if current version is supported by Hive, false otherwisepublic static boolean isHive3()
public static void assumeJavaVersion()
throws org.junit.AssumptionViolatedException
org.junit.AssumptionViolatedException - if current version is not supported by Hive,
so unit tests may be skipped.Copyright © 2021 The Apache Software Foundation. All rights reserved.