本文整理了Java中org.apache.hadoop.hive.ql.metadata.Hive.newTable()
方法的一些代码示例,展示了Hive.newTable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hive.newTable()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Hive
类名称:Hive
方法名:newTable
暂无
代码示例来源:origin: apache/hive
StorageFormat format = new StorageFormat(conf);
format.processStorageFormat("TextFile");
Table table = db.newTable(tableName);
table.setSerializationLib(format.getSerde());
List<FieldSchema> fields = new ArrayList<FieldSchema>();
代码示例来源:origin: apache/hive
Table tbl = newTable(tableName);
tbl.setInputFormatClass(fileInputFormat.getName());
tbl.setOutputFormatClass(fileOutputFormat.getName());
代码示例来源:origin: apache/drill
StorageFormat format = new StorageFormat(conf);
format.processStorageFormat("TextFile");
Table table = db.newTable(tableName);
table.setSerializationLib(format.getSerde());
List<FieldSchema> fields = new ArrayList<FieldSchema>();
代码示例来源:origin: apache/drill
Table tbl = newTable(tableName);
tbl.setInputFormatClass(fileInputFormat.getName());
tbl.setOutputFormatClass(fileOutputFormat.getName());
代码示例来源:origin: apache/hive
Table table = context.getHive().newTable(desc.getTableName());
if (desc.getLocation() != null) {
table.setDataLocation(new Path(desc.getLocation()));
代码示例来源:origin: apache/drill
Table table = db.newTable(tableName);
table.setSerializationLib(format.getSerde());
table.setFields(fields);
代码示例来源:origin: apache/hive
oldtbl.getTableType() == TableType.MATERIALIZED_VIEW) {
String targetTableName = crtTbl.getTableName();
tbl=db.newTable(targetTableName);
代码示例来源:origin: apache/drill
oldtbl.getTableType() == TableType.MATERIALIZED_VIEW) {
String targetTableName = crtTbl.getTableName();
tbl=db.newTable(targetTableName);
代码示例来源:origin: apache/drill
Table dumpTable = db.newTable(dbDotTab);
if (null != db.getTable(dumpTable.getDbName(), dumpTable.getTableName(), false) && !ctx.isExplainSkipExecution()) {
throw new SemanticException(ErrorMsg.TABLE_ALREADY_EXISTS.getMsg(dbDotTab));
代码示例来源:origin: apache/hive
Table dumpTable = db.newTable(dbDotTab);
if (null != db.getTable(dumpTable.getDbName(), dumpTable.getTableName(), false) && !ctx.isExplainSkipExecution()) {
throw new SemanticException(ErrorMsg.TABLE_ALREADY_EXISTS.getMsg(dbDotTab));
代码示例来源:origin: apache/hive
Table dumpTable = db.newTable(dbDotTable);
if (null != db.getTable(dumpTable.getDbName(), dumpTable.getTableName(), false) && !ctx.isExplainSkipExecution()) {
throw new SemanticException(ErrorMsg.TABLE_ALREADY_EXISTS.getMsg(dbDotTable));
代码示例来源:origin: apache/drill
Table tbl = db.newTable(crtView.getViewName());
tbl.setViewOriginalText(crtView.getViewOriginalText());
if (crtView.isMaterialized()) {
代码示例来源:origin: org.apache.hadoop.hive/hive-exec
/**
* Returns metadata for the table named tableName
* @param tableName the name of the table
* @return
* @throws HiveException if there's an internal error or if the
* table doesn't exist
*/
public Table getTable(final String tableName) throws HiveException {
Table t = newTable(tableName);
return this.getTable(t.getDbName(), t.getTableName(), true);
}
代码示例来源:origin: org.apache.hadoop.hive/hive-exec
public boolean dropPartition(String tblName, List<String> part_vals, boolean deleteData)
throws HiveException {
Table t = newTable(tblName);
return dropPartition(t.getDbName(), t.getTableName(), part_vals, deleteData);
}
代码示例来源:origin: org.apache.hadoop.hive/hive-exec
/**
* Returns metadata for the table named tableName
* @param tableName the name of the table
* @param throwException controls whether an exception is thrown or a returns a null
* @return
* @throws HiveException if there's an internal error or if the
* table doesn't exist
*/
public Table getTable(final String tableName, boolean throwException) throws HiveException {
Table t = newTable(tableName);
return this.getTable(t.getDbName(), t.getTableName(), throwException);
}
代码示例来源:origin: org.apache.hadoop.hive/hive-exec
public List<String> getPartitionNames(String tblName, short max) throws HiveException {
Table t = newTable(tblName);
return getPartitionNames(t.getDbName(), t.getTableName(), max);
}
代码示例来源:origin: org.apache.hadoop.hive/hive-exec
public Index getIndex(String baseTableName, String indexName) throws HiveException {
Table t = newTable(baseTableName);
return this.getIndex(t.getDbName(), t.getTableName(), indexName);
}
代码示例来源:origin: org.apache.hadoop.hive/hive-exec
/**
* Returns metadata of the table
*
* @param dbName
* the name of the database
* @param tableName
* the name of the table
* @return the table
* @exception HiveException
* if there's an internal error or if the table doesn't exist
*/
public Table getTable(final String dbName, final String tableName) throws HiveException {
if (tableName.contains(".")) {
Table t = newTable(tableName);
return this.getTable(t.getDbName(), t.getTableName(), true);
} else {
return this.getTable(dbName, tableName, true);
}
}
代码示例来源:origin: apache/lens
private Table createCubeHiveTable(AbstractCubeTable table) throws LensException {
try {
Table tbl = getClient().newTable(table.getName().toLowerCase());
tbl.setTableType(TableType.MANAGED_TABLE);
tbl.getTTable().getSd().setCols(table.getColumns());
tbl.getTTable().getParameters().putAll(table.getProperties());
getClient().createTable(tbl);
// do get to update cache
getTable(tbl.getTableName());
return tbl;
} catch (Exception e) {
throw new LensException("Exception creating table", e);
}
}
代码示例来源:origin: org.apache.lens/lens-cube
private Table createCubeHiveTable(AbstractCubeTable table) throws LensException {
try {
Table tbl = getClient().newTable(table.getName().toLowerCase());
tbl.setTableType(TableType.MANAGED_TABLE);
tbl.getTTable().getSd().setCols(table.getColumns());
tbl.getTTable().getParameters().putAll(table.getProperties());
getClient().createTable(tbl);
// do get to update cache
getTable(tbl.getTableName());
return tbl;
} catch (Exception e) {
throw new LensException("Exception creating table", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!