StorageFormat format = new StorageFormat(conf); format.processStorageFormat("TextFile"); Table table = db.newTable(tableName); table.setSerializationLib(format.getSerde()); List<FieldSchema> fields = new ArrayList<FieldSchema>();
Table tbl = newTable(tableName); tbl.setInputFormatClass(fileInputFormat.getName()); tbl.setOutputFormatClass(fileOutputFormat.getName());
StorageFormat format = new StorageFormat(conf); format.processStorageFormat("TextFile"); Table table = db.newTable(tableName); table.setSerializationLib(format.getSerde()); List<FieldSchema> fields = new ArrayList<FieldSchema>();
Table tbl = newTable(tableName); tbl.setInputFormatClass(fileInputFormat.getName()); tbl.setOutputFormatClass(fileOutputFormat.getName());
Table table = context.getHive().newTable(desc.getTableName()); if (desc.getLocation() != null) { table.setDataLocation(new Path(desc.getLocation()));
Table table = db.newTable(tableName); table.setSerializationLib(format.getSerde()); table.setFields(fields);
oldtbl.getTableType() == TableType.MATERIALIZED_VIEW) { String targetTableName = crtTbl.getTableName(); tbl=db.newTable(targetTableName);
oldtbl.getTableType() == TableType.MATERIALIZED_VIEW) { String targetTableName = crtTbl.getTableName(); tbl=db.newTable(targetTableName);
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));
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));
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));
Table tbl = db.newTable(crtView.getViewName()); tbl.setViewOriginalText(crtView.getViewOriginalText()); if (crtView.isMaterialized()) {
/** * 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); }
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); }
/** * 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); }
public List<String> getPartitionNames(String tblName, short max) throws HiveException { Table t = newTable(tblName); return getPartitionNames(t.getDbName(), t.getTableName(), max); }
public Index getIndex(String baseTableName, String indexName) throws HiveException { Table t = newTable(baseTableName); return this.getIndex(t.getDbName(), t.getTableName(), indexName); }
/** * 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); } }
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); } }
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); } }