/** * Sets the appropriate attributes in the supplied Partition object to mark * it as not archived. Note that the metastore is not touched - a separate * call to alter_partition is needed. * * @param p - the partition to modify */ private void setUnArchived(Partition p) { assert(ArchiveUtils.isArchived(p) == true); String parentDir = getOriginalLocation(p); setIsArchived(p, false, 0); setOriginalLocation(p, null); assert(parentDir != null); p.setLocation(parentDir); }
/** * Checks in partition is in custom (not-standard) location. * @param tbl - table in which partition is * @param p - partition * @return true if partition location is custom, false if it is standard */ boolean partitionInCustomLocation(Table tbl, Partition p) throws HiveException { String subdir = null; try { subdir = Warehouse.makePartName(tbl.getPartCols(), p.getValues()); } catch (MetaException e) { throw new HiveException("Unable to get partition's directory", e); } Path tableDir = tbl.getDataLocation(); if(tableDir == null) { throw new HiveException("Table has no location set"); } String standardLocation = (new Path(tableDir, subdir)).toString(); if(ArchiveUtils.isArchived(p)) { return !getOriginalLocation(p).equals(standardLocation); } else { return !p.getLocation().equals(standardLocation); } }
/** * Sets the appropriate attributes in the supplied Partition object to mark * it as not archived. Note that the metastore is not touched - a separate * call to alter_partition is needed. * * @param p - the partition to modify */ private void setUnArchived(Partition p) { assert(ArchiveUtils.isArchived(p) == true); String parentDir = getOriginalLocation(p); setIsArchived(p, false, 0); setOriginalLocation(p, null); assert(parentDir != null); p.setLocation(parentDir); }
/** * Checks in partition is in custom (not-standard) location. * @param tbl - table in which partition is * @param p - partition * @return true if partition location is custom, false if it is standard */ boolean partitionInCustomLocation(Table tbl, Partition p) throws HiveException { String subdir = null; try { subdir = Warehouse.makePartName(tbl.getPartCols(), p.getValues()); } catch (MetaException e) { throw new HiveException("Unable to get partition's directory", e); } Path tableDir = tbl.getDataLocation(); if(tableDir == null) { throw new HiveException("Table has no location set"); } String standardLocation = (new Path(tableDir, subdir)).toString(); if(ArchiveUtils.isArchived(p)) { return !getOriginalLocation(p).equals(standardLocation); } else { return !p.getLocation().equals(standardLocation); } }
originalDir = new Path(getOriginalLocation(p)); } else { originalDir = p.getDataLocation();
Partition p = partitions.get(0); if(ArchiveUtils.isArchived(p)) { originalDir = new Path(getOriginalLocation(p)); } else { originalDir = new Path(p.getLocation());
originalDir = new Path(getOriginalLocation(p)); } else { originalDir = p.getDataLocation();
Partition p = partitions.get(0); if(ArchiveUtils.isArchived(p)) { originalDir = new Path(getOriginalLocation(p)); } else { originalDir = new Path(p.getLocation());
/** * Sets the appropriate attributes in the supplied Partition object to mark * it as not archived. Note that the metastore is not touched - a separate * call to alter_partition is needed. * * @param p - the partition to modify */ private void setUnArchived(Partition p) { assert(isArchived(p) == true); String parentDir = getOriginalLocation(p); setIsArchived(p, false); setOriginalLocation(p, null); assert(parentDir != null); p.setLocation(parentDir); }
/** * Sets the appropriate attributes in the supplied Partition object to mark * it as not archived. Note that the metastore is not touched - a separate * call to alter_partition is needed. * * @param p - the partition to modify */ private void setUnArchived(Partition p) { assert(ArchiveUtils.isArchived(p) == true); String parentDir = getOriginalLocation(p); setIsArchived(p, false, 0); setOriginalLocation(p, null); assert(parentDir != null); p.setLocation(parentDir); }
/** * Checks in partition is in custom (not-standard) location. * @param tbl - table in which partition is * @param p - partition * @return true if partition location is custom, false if it is standard */ boolean partitionInCustomLocation(Table tbl, Partition p) throws HiveException { String subdir = null; try { subdir = Warehouse.makePartName(tbl.getPartCols(), p.getValues()); } catch (MetaException e) { throw new HiveException("Unable to get partition's directory", e); } Path tableDir = tbl.getDataLocation(); if(tableDir == null) { throw new HiveException("Table has no location set"); } String standardLocation = (new Path(tableDir, subdir)).toString(); if(ArchiveUtils.isArchived(p)) { return !getOriginalLocation(p).equals(standardLocation); } else { return !p.getLocation().equals(standardLocation); } }
Path originalLocation = new Path(getOriginalLocation(p)); Path sourceDir = new Path(p.getLocation()); Path intermediateArchiveDir = new Path(originalLocation.getParent(),
originalDir = new Path(getOriginalLocation(p)); } else { originalDir = p.getDataLocation();
Partition p = partitions.get(0); if(ArchiveUtils.isArchived(p)) { originalDir = new Path(getOriginalLocation(p)); } else { originalDir = new Path(p.getLocation());
Path originalDir = new Path(getOriginalLocation(p)); Path leftOverIntermediateOriginal = new Path(originalDir.getParent(), originalDir.getName() + INTERMEDIATE_ORIGINAL_DIR_SUFFIX);