public String getLocation() { switch (getDescType()) { case TABLE: return createTblDesc.getLocation(); case VIEW: return createViewDesc.getLocation(); } return null; }
public String getLocation() { switch (getTableType()) { case TABLE: return createTblDesc.getLocation(); case VIEW: return createViewDesc.getLocation(); } return null; }
private void setLoadFileLocation( final ParseContext pCtx, LoadFileDesc lfd) throws SemanticException { // CTAS; make the movetask's destination directory the table's destination. Long txnIdForCtas = null; int stmtId = 0; // CTAS cannot be part of multi-txn stmt FileSinkDesc dataSinkForCtas = null; String loc = null; if (pCtx.getQueryProperties().isCTAS()) { CreateTableDesc ctd = pCtx.getCreateTable(); dataSinkForCtas = ctd.getAndUnsetWriter(); txnIdForCtas = ctd.getInitialMmWriteId(); loc = ctd.getLocation(); } else { loc = pCtx.getCreateViewDesc().getLocation(); } Path location = (loc == null) ? getDefaultCtasLocation(pCtx) : new Path(loc); if (txnIdForCtas != null) { dataSinkForCtas.setDirName(location); location = new Path(location, AcidUtils.deltaSubdir(txnIdForCtas, txnIdForCtas, stmtId)); lfd.setSourcePath(location); if (Utilities.FILE_OP_LOGGER.isTraceEnabled()) { Utilities.FILE_OP_LOGGER.trace("Setting MM CTAS to " + location); } } if (Utilities.FILE_OP_LOGGER.isTraceEnabled()) { Utilities.FILE_OP_LOGGER.trace("Location for LFD is being set to " + location + "; moving from " + lfd.getSourcePath()); } lfd.setTargetDir(location); }
try { Table table = context.getHive().newTable(desc.getTableName()); if (desc.getLocation() != null) { table.setDataLocation(new Path(desc.getLocation()));
tbl.setProperty("comment", getComment()); if (getLocation() != null) { tbl.setDataLocation(new Path(getLocation())); if (getLocation() == null && !this.isCTAS) { if (!tbl.isPartitioned() && conf.getBoolVar(HiveConf.ConfVars.HIVESTATSAUTOGATHER)) { StatsSetupConst.setBasicStatsStateForCreateTable(tbl.getTTable().getParameters(),
tbl.setProperty("comment", getComment()); if (getLocation() != null) { tbl.setDataLocation(new Path(getLocation()));
if (qb.getTableDesc() != null && qb.getTableDesc().getLocation() != null) { location = new Path(qb.getTableDesc().getLocation()); } else {
if (qb.getTableDesc() != null && qb.getTableDesc().getLocation() != null) { location = new Path(qb.getTableDesc().getLocation()); } else {
pCtx.getCreateTable().getLocation() : pCtx.getCreateViewDesc().getLocation(); if (loc == null) {
/** * Helper method to set location properly in partSpec */ private void fixLocationInPartSpec( FileSystem fs, CreateTableDesc tblDesc, Table table, Warehouse wh, ReplicationSpec replicationSpec, AddPartitionDesc.OnePartitionDesc partSpec) throws MetaException, HiveException, IOException { Path tgtPath = null; if (tblDesc.getLocation() == null) { if (table.getDataLocation() != null) { tgtPath = new Path(table.getDataLocation().toString(), Warehouse.makePartPath(partSpec.getPartSpec())); } else { Database parentDb = db.getDatabase(tblDesc.getDatabaseName()); tgtPath = new Path( wh.getTablePath( parentDb, tblDesc.getTableName()), Warehouse.makePartPath(partSpec.getPartSpec())); } } else { tgtPath = new Path(tblDesc.getLocation(), Warehouse.makePartPath(partSpec.getPartSpec())); } checkTargetLocationEmpty(fs, tgtPath, replicationSpec); partSpec.setLocation(tgtPath.toString()); }
try { Table table = context.getHive().newTable(desc.getTableName()); if (desc.getLocation() != null) { table.setDataLocation(new Path(desc.getLocation()));
try { Table table = context.getHive().newTable(desc.getTableName()); if (desc.getLocation() != null) { table.setDataLocation(new Path(desc.getLocation()));
try { Table table = context.getHive().newTable(desc.getTableName()); if (desc.getLocation() != null) { table.setDataLocation(new Path(desc.getLocation()));
try { Table table = context.getHive().newTable(desc.getTableName()); if (desc.getLocation() != null) { table.setDataLocation(new Path(desc.getLocation()));
if (tblDesc.isExternal() && (tblDesc.getLocation() == null)) { LOG.debug("Importing in place, no emptiness check, no copying/loading"); Path dataPath = new Path(fromURI.toString(), "data"); } else { Path tablePath = null; if (tblDesc.getLocation() != null) { tablePath = new Path(tblDesc.getLocation()); } else { tablePath = wh.getTablePath(parentDb, tblDesc.getTableName());
tbl.setProperty("comment", crtTbl.getComment()); if (crtTbl.getLocation() != null) { tbl.setDataLocation(new Path(crtTbl.getLocation()).toUri());
throws MetaException, IOException, HiveException { AddPartitionDesc.OnePartitionDesc partSpec = addPartitionDesc.getPartition(0); if (tblDesc.isExternal() && tblDesc.getLocation() == null) { LOG.debug("Importing in-place: adding AddPart for partition " + partSpecToString(partSpec.getPartSpec()));
throw new SemanticException(ErrorMsg.DATABASE_NOT_EXISTS.getMsg(tblDesc.getDatabaseName())); if (tblDesc.getLocation() == null) { tblDesc.setLocation(wh.getTablePath(parentDb, tblDesc.getTableName()).toString());
if ((tableDesc.getLocation() != null) && (!table.isPartitioned()) && (!table.getDataLocation().equals(new Path(tableDesc.getLocation()))) ){ throw new SemanticException( ErrorMsg.INCOMPATIBLE_SCHEMA.getMsg(" Location does not match"));
String loc = pCtx.getCreateTable().getLocation(); if (loc == null) {