congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HCatCreateDBDesc$Builder.build
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/hive

@Test
public void testGetMessageBusTopicName() throws Exception {
 try {
  HCatClient client = HCatClient.create(new Configuration(hcatConf));
  String dbName = "testGetMessageBusTopicName_DBName";
  String tableName = "testGetMessageBusTopicName_TableName";
  client.dropDatabase(dbName, true, HCatClient.DropDBMode.CASCADE);
  client.createDatabase(HCatCreateDBDesc.create(dbName).build());
  String messageBusTopicName = "MY.topic.name";
  Map<String, String> tableProperties = new HashMap<String, String>(1);
  tableProperties.put(HCatConstants.HCAT_MSGBUS_TOPIC_NAME, messageBusTopicName);
  client.createTable(HCatCreateTableDesc.create(dbName, tableName, Arrays.asList(new HCatFieldSchema("foo", Type.STRING, ""))).tblProps(tableProperties).build());
  assertEquals("MessageBus topic-name doesn't match!", messageBusTopicName, client.getMessageBusTopicName(dbName, tableName));
  client.dropDatabase(dbName, true, HCatClient.DropDBMode.CASCADE);
  client.close();
 }
 catch (Exception exception) {
  LOG.error("Unexpected exception.", exception);
  assertTrue("Unexpected exception:" + exception.getMessage(), false);
 }
}
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);
 }
}
origin: apache/hive

@Test
public void testUpdateTableSchema() throws Exception {
 try {
  HCatClient client = HCatClient.create(new Configuration(hcatConf));
  final String dbName = "testUpdateTableSchema_DBName";
  final String tableName = "testUpdateTableSchema_TableName";
  client.dropDatabase(dbName, true, HCatClient.DropDBMode.CASCADE);
  client.createDatabase(HCatCreateDBDesc.create(dbName).build());
  List<HCatFieldSchema> oldSchema = Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""),
    new HCatFieldSchema("bar", Type.STRING, ""));
  client.createTable(HCatCreateTableDesc.create(dbName, tableName, oldSchema).build());
  List<HCatFieldSchema> newSchema = Arrays.asList(new HCatFieldSchema("completely", Type.DOUBLE, ""),
    new HCatFieldSchema("new", Type.STRING, ""),
    new HCatFieldSchema("fields", Type.STRING, ""));
  client.updateTableSchema(dbName, tableName, newSchema);
  assertArrayEquals(newSchema.toArray(), client.getTable(dbName, tableName).getCols().toArray());
  client.dropDatabase(dbName, false, HCatClient.DropDBMode.CASCADE);
 }
 catch (Exception exception) {
  LOG.error("Unexpected exception.", exception);
  assertTrue("Unexpected exception: " + exception.getMessage(), false);
 }
}
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: apache/hive

sourceMetastore.createDatabase(HCatCreateDBDesc.create(dbName).ifNotExists(false).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 = 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

 .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).ifNotExists(false).build());
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).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());
List<HCatFieldSchema> columnSchema = Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""),
  new HCatFieldSchema("bar", Type.STRING, ""));
origin: apache/hive

@Test
public void testDropDatabaseCommand() throws HCatException {
 String dbName = "cmd_testdb";
 int evid = 999;
 Command testCmd = new DropDatabaseCommand(dbName, evid);
 assertEquals(evid,testCmd.getEventId());
 assertEquals(1, testCmd.get().size());
 assertEquals(true,testCmd.isRetriable());
 assertEquals(false,testCmd.isUndoable());
 CommandTestUtils.testCommandSerialization(testCmd);
 client.dropDatabase(dbName, true, HCatClient.DropDBMode.CASCADE);
 client.createDatabase(HCatCreateDBDesc.create(dbName).ifNotExists(false).build());
 HCatDatabase db = client.getDatabase(dbName);
 assertNotNull(db);
 LOG.info("About to run :"+testCmd.get().get(0));
 driver.run(testCmd.get().get(0));
 Exception onfe = null;
 try {
  HCatDatabase db_del = client.getDatabase(dbName);
 } catch (Exception e) {
  onfe = e;
 }
 assertNotNull(onfe);
 assertTrue(onfe instanceof ObjectNotFoundException);
}
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();
}
org.apache.hive.hcatalog.apiHCatCreateDBDesc$Builderbuild

Javadoc

Builds the create database descriptor.

Popular methods of HCatCreateDBDesc$Builder

  • <init>
  • ifNotExists
    If not exists.
  • location
    Location.

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Menu (java.awt)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top Vim plugins
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