use of com.qlangtech.tis.hive.DefaultHiveConnGetter in project plugins by qlangtech.
the class TestDataXHiveWriter method testDataDump.
public void testDataDump() throws Exception {
HdfsFileSystemFactory hdfsFileSystemFactory = HdfsFileSystemFactoryTestUtils.getFileSystemFactory();
final DefaultHiveConnGetter hiveConnGetter = new DefaultHiveConnGetter();
hiveConnGetter.dbName = "tis";
hiveConnGetter.hiveAddress = "192.168.28.200:10000";
final DataXHiveWriter dataxWriter = new DataXHiveWriter() {
@Override
public IHiveConnGetter getHiveConnGetter() {
return hiveConnGetter;
}
@Override
public FileSystemFactory getFs() {
return hdfsFileSystemFactory;
}
@Override
public Class<?> getOwnerClass() {
return DataXHiveWriter.class;
}
};
DataxWriter.dataxWriterGetter = (name) -> {
assertEquals("mysql2hive", name);
return dataxWriter;
};
WriterTemplate.realExecuteDump("hive-datax-writer-assert-without-option-val.json", dataxWriter);
}
use of com.qlangtech.tis.hive.DefaultHiveConnGetter in project plugins by qlangtech.
the class TestDataXSparkWriter method testDataDump.
public void testDataDump() throws Exception {
// final DataxWriter dataxWriter = DataxWriter.load(null, mysql2hiveDataXName);
HdfsFileSystemFactory hdfsFileSystemFactory = HdfsFileSystemFactoryTestUtils.getFileSystemFactory();
ITISFileSystem fileSystem = hdfsFileSystemFactory.getFileSystem();
final DefaultHiveConnGetter hiveConnGetter = new DefaultHiveConnGetter();
hiveConnGetter.dbName = "tis";
hiveConnGetter.hiveAddress = "192.168.28.200:10000";
// HdfsPath historicalPath = new HdfsPath(hdfsFileSystemFactory.rootDir + "/" + hiveConnGetter.dbName + "/customer_order_relation");
// fileSystem.delete(historicalPath, true);
final DataXSparkWriter dataxWriter = new DataXSparkWriter() {
@Override
public IHiveConnGetter getHiveConnGetter() {
return hiveConnGetter;
}
@Override
public FileSystemFactory getFs() {
return hdfsFileSystemFactory;
}
@Override
public Class<?> getOwnerClass() {
return DataXSparkWriter.class;
}
};
DataxWriter.dataxWriterGetter = (name) -> {
assertEquals(mysql2hiveDataXName, name);
return dataxWriter;
};
WriterTemplate.realExecuteDump("spark-datax-writer-assert-without-option-val.json", dataxWriter);
}
Aggregations