@InterfaceAudience.Developer(value="Test") public class TestUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.hadoop.conf.Configuration |
configuration |
| Constructor and Description |
|---|
TestUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
cleanMdtFile()
verify whether the file exists
if delete the file success or file not exists, then return true; otherwise return false
|
static org.apache.avro.generic.GenericData.Record |
jsonToAvro(String json,
String avroSchema) |
static boolean |
verifyMdtFile()
verify whether the mdt file exists
if the file exists, then return true; otherwise return false
|
static void |
writeFilesAndVerify(int rows,
Schema schema,
String path)
write file and verify
|
static void |
writeFilesAndVerify(int rows,
Schema schema,
String path,
String[] sortColumns,
int blockletSize,
int blockSize)
Invoke CarbonWriter API to write carbon files and assert the file is rewritten
|
static void |
writeFilesAndVerify(Schema schema,
String path) |
public static org.apache.avro.generic.GenericData.Record jsonToAvro(String json, String avroSchema) throws IOException
IOExceptionpublic static void writeFilesAndVerify(int rows,
Schema schema,
String path)
rows - number of rowsschema - schemapath - table store pathpublic static void writeFilesAndVerify(int rows,
Schema schema,
String path,
String[] sortColumns,
int blockletSize,
int blockSize)
rows - number of rows to writeschema - schema of the filepath - local write pathsortColumns - sort columnsblockletSize - blockletSize in the file, -1 for default sizeblockSize - blockSize in the file, -1 for default sizepublic static boolean cleanMdtFile()
public static boolean verifyMdtFile()
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.