public class TestDataLoader extends Object implements org.junit.rules.TestRule
Constructor and Description |
---|
TestDataLoader(TestHiveServer hiveServer)
Constructs a new TestDataLoader
|
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
Uses a TemporaryFolder rule to process a given statement
The TemporaryFolder will be used to construct staging files for loading data into Hive
|
void |
loadDataIntoTable(String tableName,
TextResource tableDataResource)
Loads data from a TextResource into a hive table
A temporary file on the local file system is used as a staging ground for the data
|
void |
loadDataIntoTable(String tableName,
TextResource tableDataResource,
String partitionInfo)
Loads data from a TextResource into a hive table
A temporary file on the local file system is used as a staging ground for the data
|
public TestDataLoader(TestHiveServer hiveServer)
hiveServer
- the TestHiveServer to load data intopublic org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
base
- the statement to apply a TemporaryFolder todescription
- the description to apply a TemporaryFolder topublic void loadDataIntoTable(String tableName, TextResource tableDataResource)
tableName
- the name of the tabletableDataResource
- the resource to extract data frompublic void loadDataIntoTable(String tableName, TextResource tableDataResource, String partitionInfo)
tableName
- the name of the tabletableDataResource
- the resource to extract data frompartitionInfo
- the optional partitioning commands at the end of a 'LOAD DATA' queryCopyright © 2016. All rights reserved.