Tabnine Logo
HCatCreateDBDesc$Builder
Code IndexAdd Tabnine to your IDE (free)

How to use
HCatCreateDBDesc$Builder
in
org.apache.hive.hcatalog.api

Best Java code snippets using org.apache.hive.hcatalog.api.HCatCreateDBDesc$Builder (Showing top 20 results out of 315)

origin: apache/hive

sourceMetastore.createDatabase(HCatCreateDBDesc.create(dbName).ifNotExists(false).build());
origin: apache/hive

@Test
public void testDatabaseLocation() throws Exception {
 HCatClient client = HCatClient.create(new Configuration(hcatConf));
 String dbName = "locationDB";
 client.dropDatabase(dbName, true, HCatClient.DropDBMode.CASCADE);
 HCatCreateDBDesc dbDesc = HCatCreateDBDesc.create(dbName)
  .ifNotExists(true).location("/tmp/" + dbName).build();
 client.createDatabase(dbDesc);
 HCatDatabase newDB = client.getDatabase(dbName);
 assertTrue(newDB.getLocation().matches(".*/tmp/" + dbName));
 client.close();
}
origin: com.github.hyukjinkwon.hcatalog/hive-webhcat-java-client

/**
 * Creates the builder for defining attributes.
 *
 * @param dbName the db name
 * @return the builder
 */
public static Builder create(String dbName) {
 return new Builder(dbName);
}
origin: org.apache.hive.hcatalog/hive-webhcat-java-client

/**
 * Creates the builder for defining attributes.
 *
 * @param dbName the db name
 * @return the builder
 */
public static Builder create(String dbName) {
 return new Builder(dbName);
}
origin: apache/oozie

public void createDatabase(String db, String location) throws Exception {
  HCatCreateDBDesc dbDesc = HCatCreateDBDesc.create(db).ifNotExists(true).location(location).build();
  hcatClient.createDatabase(dbDesc);
  List<String> dbNames = hcatClient.listDatabaseNamesByPattern(db);
  Assert.assertTrue(dbNames.contains(db));
}
origin: org.spark-project.hive.hcatalog/hive-webhcat-java-client

/**
 * Creates the builder for defining attributes.
 *
 * @param dbName the db name
 * @return the builder
 */
public static Builder create(String dbName) {
 return new Builder(dbName);
}
origin: apache/hive

sourceMetaStore().createDatabase(HCatCreateDBDesc.create(dbName).build());
List<HCatFieldSchema> columnSchema = new ArrayList<HCatFieldSchema>(
  Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""),
targetMetaStore().createDatabase(HCatCreateDBDesc.create(dbName).build());
origin: apache/hive

sourceMetaStore().createDatabase(HCatCreateDBDesc.create(dbName).build());
List<HCatFieldSchema> columnSchema = new ArrayList<HCatFieldSchema>(
  Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""),
targetMetaStore().createDatabase(HCatCreateDBDesc.create(dbName).build());
origin: apache/hive

sourceMetaStore().createDatabase(HCatCreateDBDesc.create(dbName).build());
List<HCatFieldSchema> columnSchema = Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""),
  new HCatFieldSchema("bar", Type.STRING, ""));
targetMetaStore().createDatabase(HCatCreateDBDesc.create(dbName).build());
origin: apache/hive

client.dropDatabase(db, true, HCatClient.DropDBMode.CASCADE);
HCatCreateDBDesc dbDesc = HCatCreateDBDesc.create(db).ifNotExists(false)
 .build();
client.createDatabase(dbDesc);
List<String> dbNames = client.listDatabaseNamesByPattern("*");
origin: apache/hive

client.createDatabase(HCatCreateDBDesc.create(dbName).ifNotExists(false).build());
origin: apache/hive

client.createDatabase(HCatCreateDBDesc.create(dbName).ifNotExists(false).build());
origin: apache/hive

 .ifNotExists(true).build();
client.createDatabase(dbDesc);
ArrayList<HCatFieldSchema> cols = new ArrayList<HCatFieldSchema>();
origin: apache/hive

client.createDatabase(HCatCreateDBDesc.create(dbName).build());
List<HCatFieldSchema> columnSchema = Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""),
  new HCatFieldSchema("bar", Type.STRING, ""));
origin: apache/hive

client.createDatabase(HCatCreateDBDesc.create(dbName).build());
origin: apache/hive

client.createDatabase(HCatCreateDBDesc.create(dbName).ifNotExists(false).build());
origin: apache/hive

client.createDatabase(HCatCreateDBDesc.create(dbName).ifNotExists(false).build());
origin: apache/hive

client.createDatabase(HCatCreateDBDesc.create(dbName).ifNotExists(false).build());
origin: apache/hive

client.createDatabase(HCatCreateDBDesc.create(dbName).build());
List<HCatFieldSchema> columnSchema = Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""),
  new HCatFieldSchema("bar", Type.STRING, ""));
origin: apache/hive

@Test
public void testPartitionSchema() throws Exception {
 try {
  HCatClient client = HCatClient.create(new Configuration(hcatConf));
  final String dbName = "myDb";
  final String tableName = "myTable";
  client.dropDatabase(dbName, true, HCatClient.DropDBMode.CASCADE);
  client.createDatabase(HCatCreateDBDesc.create(dbName).build());
  List<HCatFieldSchema> columnSchema = Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""),
    new HCatFieldSchema("bar", Type.STRING, ""));
  List<HCatFieldSchema> partitionSchema = Arrays.asList(new HCatFieldSchema("dt", Type.STRING, ""),
    new HCatFieldSchema("grid", Type.STRING, ""));
  client.createTable(HCatCreateTableDesc.create(dbName, tableName, columnSchema).partCols(partitionSchema).build());
  HCatTable table = client.getTable(dbName, tableName);
  List<HCatFieldSchema> partitionColumns = table.getPartCols();
  assertArrayEquals("Didn't get expected partition-schema back from the HCatTable.",
    partitionSchema.toArray(), partitionColumns.toArray());
  client.dropDatabase(dbName, false, HCatClient.DropDBMode.CASCADE);
 }
 catch (Exception unexpected) {
  LOG.error("Unexpected exception!", unexpected);
  assertTrue("Unexpected exception! " + unexpected.getMessage(), false);
 }
}
org.apache.hive.hcatalog.apiHCatCreateDBDesc$Builder

Most used methods

  • <init>
  • build
    Builds the create database descriptor.
  • ifNotExists
    If not exists.
  • location
    Location.

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now