Tabnine Logo
org.apache.hive.hcatalog.api
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.hive.hcatalog.api

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

origin: apache/hive

@Override
public HCatPartition deserializePartition(String hcatPartitionStringRep) throws HCatException {
 HCatPartition hcatPartition = MetadataSerializer.get().deserializePartition(hcatPartitionStringRep);
 hcatPartition.hcatTable(getTable(hcatPartition.getDatabaseName(), hcatPartition.getTableName()));
 return hcatPartition;
}
origin: apache/hive

 @Override
 public HCatPartitionSpec deserializePartitionSpec(List<String> hcatPartitionSpecStrings) throws HCatException {
  HCatPartitionSpec hcatPartitionSpec = MetadataSerializer.get()
    .deserializePartitionSpec(hcatPartitionSpecStrings);
  hcatPartitionSpec
    .hcatTable(getTable(hcatPartitionSpec.getDbName(), hcatPartitionSpec.getTableName()));
  return hcatPartitionSpec;
 }
}
origin: apache/hive

/**
 * Getter for HCatCreateTableDesc.Builder instance. By default, ifNotExists is false.
 * So the attempt to create the table is made even if the table already exists.
 * @param table Spec for HCatTable to be created.
 * @return Builder instance.
 */
public static Builder create(HCatTable table) {
 return new Builder(table, false);
}
origin: apache/hive

HCatPartition getHCatPartition(HCatTable hcatTable) throws HCatException {
 assert hcatPartition == null : "hcatPartition should have been null at this point.";
 assert dbName.equalsIgnoreCase(hcatTable.getDbName()) : "DB names don't match.";
 assert tableName.equalsIgnoreCase(hcatTable.getTableName()) : "Table names don't match.";
 return new HCatPartition(hcatTable, partitionKeyValues, location);
}
origin: apache/hive

public HCatPartition hcatTable(HCatTable hcatTable) {
 this.hcatTable = hcatTable;
 this.tableName = hcatTable.getTableName();
 this.dbName = hcatTable.getDbName();
 return this;
}
origin: apache/hive

/**
 * Setter for table-type.
 */
public HCatTable tableType(Type tableType) {
 this.tableType = tableType.name();
 this.isExternal = tableType.equals(Type.EXTERNAL_TABLE);
 return this;
}
origin: apache/hive

@Override
public String serializeTable(HCatTable hcatTable) throws HCatException {
 return MetadataSerializer.get().serializeTable(hcatTable);
}
origin: apache/hive

@Override
public HCatTable deserializeTable(String hcatTableStringRep) throws HCatException {
 return MetadataSerializer.get().deserializeTable(hcatTableStringRep);
}
origin: apache/hive

/**
 * Gets the partition columns of the table.
 *
 * @return the partition columns
 */
public List<HCatFieldSchema> getPartColumns() {
 return hcatTable.getPartCols();
}
origin: apache/hive

/**
 * Method to compare the attributes of 2 HCatTable instances.
 * Only the {@code DEFAULT_COMPARISON_ATTRIBUTES} are compared.
 * @param rhs The other table being compared against. Can't be null.
 * @return {@code EnumSet<TableAttribute>} containing all the attribute that differ between {@code this} and rhs.
 * Subset of {@code DEFAULT_COMPARISON_ATTRIBUTES}.
 */
public EnumSet<TableAttribute> diff (HCatTable rhs) {
 return diff(rhs, DEFAULT_COMPARISON_ATTRIBUTES);
}
origin: apache/hive

/**
 * Setter for HCatTable. Required for deserialization.
 */
void hcatTable(HCatTable hcatTable) throws HCatException {
 assert this.hcatTable == null : "Expected hcatTable to be null at this point.";
 this.hcatTable = hcatTable;
 assert_invariant();
}
origin: apache/hive

/**
 * 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

@Override
public String toString() {
 return "HCatCreateTableDesc [ " + hcatTable.toString()
   + ", ifNotExists = " + ifNotExists + "]";
}
origin: apache/hive

 /**
  * Builds the HCatAddPartitionDesc.
  *
  * @return the h cat add partition desc
  * @throws HCatException
  */
 public HCatAddPartitionDesc build() throws HCatException {
  return hcatPartition == null?
       new HCatAddPartitionDesc(dbName, tableName, location, partitionSpec)
      : new HCatAddPartitionDesc(hcatPartition);
 }
}
origin: apache/hive

@Override
public void dropPartitions(String dbName, String tableName,
              Map<String, String> partitionSpec, boolean ifExists) throws HCatException {
 dropPartitions(dbName, tableName, partitionSpec, ifExists, true);
}
origin: apache/hive

/**
 * Static getter method for the appropriate MetadataSerializer implementation.
 * @return MetadataSerializer sub-class.
 * @throws HCatException On failure to construct a concrete MetadataSerializer.
 */
public static MetadataSerializer get() throws HCatException {
 return new MetadataJSONSerializer();
}
origin: apache/hive

/**
 * Constructs a Builder instance, using an HCatPartition object.
 * @param partition An HCatPartition instance.
 * @return A Builder object that can build an appropriate HCatAddPartitionDesc.
 * @throws HCatException
 */
public static Builder create(HCatPartition partition) throws HCatException {
 return new Builder(partition);
}
origin: apache/hive

/**
 * Builds the HCatCreateTableDesc.
 *
 * @return HCatCreateTableDesc
 * @throws HCatException
 */
public HCatCreateTableDesc build() throws HCatException {
 return new HCatCreateTableDesc(this.hcatTable, this.ifNotExists);
}
origin: apache/hive

/**
 * Getter for HCatCreateTableDesc.Builder instance.
 * @param table Spec for HCatTable to be created.
 * @param ifNotExists Only create the table if it doesn't already exist.
 * @return Builder instance.
 */
public static Builder create(HCatTable table, boolean ifNotExists) {
 return new Builder(table, ifNotExists);
}
origin: apache/hive

protected HCatPartitionSpec(HCatTable hcatTable, PartitionSpecProxy partitionSpecProxy) throws HCatException {
 this.hcatTable = hcatTable;
 this.partitionSpecProxy = partitionSpecProxy;
 assert_invariant();
}
org.apache.hive.hcatalog.api

Most used classes

  • HCatClient
    The abstract class HCatClient containing APIs for HCatalog DDL commands.
  • HCatAddPartitionDesc$Builder
    Builder class for constructing an HCatAddPartition instance.
  • HCatAddPartitionDesc
    The Class HCatAddPartitionDesc helps users in defining partition attributes.
  • HCatCreateDBDesc$Builder
  • HCatCreateDBDesc
    The Class HCatCreateDBDesc for defining database attributes.
  • HCatCreateTableDesc,
  • HCatTable,
  • HCatDatabase,
  • HCatNotificationEvent,
  • HCatPartition,
  • HCatPartitionSpec$HCatPartitionIterator,
  • HCatPartitionSpec,
  • Command,
  • NoopReplicationTask,
  • ReplicationTask,
  • ReplicationUtils,
  • StagingDirectoryProvider,
  • DropDatabaseCommand,
  • DropPartitionCommand
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