Java Code Examples for

The following examples show how to use These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tajo   Source File:    License: Apache License 2.0 6 votes vote down vote up
public static void setUp() throws Exception {
  formatFactory = new StorageFormatFactory();
  Path testPath = CommonTestingUtil.getTestDir();
  warehousePath = new Path(testPath, "warehouse");

  //create local hiveMeta
  HiveConf conf = new HiveConf();
  String jdbcUri = "jdbc:derby:;databaseName="+testPath.toUri().getPath()+"metastore_db;create=true";
  conf.set(HiveConf.ConfVars.METASTOREWAREHOUSE.varname, warehousePath.toUri().toString());
  conf.set(HiveConf.ConfVars.METASTORECONNECTURLKEY.varname, jdbcUri);
  conf.set(TajoConf.ConfVars.WAREHOUSE_DIR.varname, warehousePath.toUri().toString());
  conf.setBoolean("datanucleus.schema.autoCreateAll", true);

  // create local HiveCatalogStore.
  TajoConf tajoConf = new TajoConf(conf);
  store = new HiveCatalogStore(tajoConf);
  store.createDatabase(DB_NAME, null);