public static Map<String, String> getFullPartSpecAsMap(XPartition partition) { Map<String, String> spec = Maps.newHashMap(); if (partition.getTimePartitionSpec() != null) { for (XTimePartSpecElement timePartSpecElement : partition.getTimePartitionSpec().getPartSpecElement()) { spec.put(timePartSpecElement.getKey(), UpdatePeriod.valueOf(partition.getUpdatePeriod().name()).format() .format(getDateFromXML(timePartSpecElement.getValue()))); } } if (partition.getNonTimePartitionSpec() != null) { for (XPartSpecElement partSpecElement : partition.getNonTimePartitionSpec().getPartSpecElement()) { spec.put(partSpecElement.getKey(), partSpecElement.getValue()); } } return spec; } }
public static Map<String, String> getFullPartSpecAsMap(XPartition partition) { Map<String, String> spec = Maps.newHashMap(); if (partition.getTimePartitionSpec() != null) { for (XTimePartSpecElement timePartSpecElement : partition.getTimePartitionSpec().getPartSpecElement()) { spec.put(timePartSpecElement.getKey(), UpdatePeriod.valueOf(partition.getUpdatePeriod().name()).format() .format(getDateFromXML(timePartSpecElement.getValue()))); } } if (partition.getNonTimePartitionSpec() != null) { for (XPartSpecElement partSpecElement : partition.getNonTimePartitionSpec().getPartSpecElement()) { spec.put(partSpecElement.getKey(), partSpecElement.getValue()); } } return spec; } }
partSpecElement.setKey(entry.getKey()); partSpecElement.setValue(entry.getValue()); xp.getNonTimePartitionSpec().getPartSpecElement().add(partSpecElement);
partSpecElement.setKey(entry.getKey()); partSpecElement.setValue(entry.getValue()); xp.getNonTimePartitionSpec().getPartSpecElement().add(partSpecElement);
assertEquals(readPartition.getLocation(), xp.getLocation()); assertEquals(readPartition.getTimePartitionSpec(), xp.getTimePartitionSpec()); assertEquals(readPartition.getNonTimePartitionSpec(), xp.getNonTimePartitionSpec()); assertNotNull(readPartition.getFullPartitionSpec()); XTimePartSpecElement timePartSpec = readPartition.getTimePartitionSpec().getPartSpecElement().iterator().next();
assertEquals(postedPartition.getNonTimePartitionSpec(), xp.getNonTimePartitionSpec()); assertNotNull(postedPartition.getFullPartitionSpec()); assertNull(latestPartition.getNonTimePartitionSpec()); assertEquals(latestPartition.getFullPartitionSpec().getPartSpecElement().get(0).getValue(), "latest");
assertEquals(readPartition.getLocation(), xp.getLocation()); assertEquals(readPartition.getTimePartitionSpec(), xp.getTimePartitionSpec()); assertEquals(readPartition.getNonTimePartitionSpec(), xp.getNonTimePartitionSpec()); assertNotNull(readPartition.getFullPartitionSpec()); XTimePartSpecElement timePartSpec = readPartition.getTimePartitionSpec().getPartSpecElement().iterator().next();
public static StoragePartitionDesc storagePartSpecFromXPartition( XPartition xpart) { StoragePartitionDesc partDesc = new StoragePartitionDesc( xpart.getFactOrDimensionTableName(), timePartSpecfromXTimePartSpec(xpart.getTimePartitionSpec()), nonTimePartSpecfromXNonTimePartSpec(xpart.getNonTimePartitionSpec()), UpdatePeriod.valueOf(xpart.getUpdatePeriod().name())); partDesc.setPartParams(mapFromXProperties(xpart.getPartitionParameters())); partDesc.setSerdeParams(mapFromXProperties(xpart.getSerdeParameters())); partDesc.setLocation(xpart.getLocation()); partDesc.setInputFormat(xpart.getInputFormat()); partDesc.setOutputFormat(xpart.getOutputFormat()); partDesc.setSerializationLib(xpart.getSerdeClassname()); return partDesc; }
public static StoragePartitionDesc storagePartSpecFromXPartition( XPartition xpart) { StoragePartitionDesc partDesc = new StoragePartitionDesc( xpart.getFactOrDimensionTableName(), timePartSpecfromXTimePartSpec(xpart.getTimePartitionSpec()), nonTimePartSpecfromXNonTimePartSpec(xpart.getNonTimePartitionSpec()), UpdatePeriod.valueOf(xpart.getUpdatePeriod().name())); partDesc.setPartParams(mapFromXProperties(xpart.getPartitionParameters())); partDesc.setSerdeParams(mapFromXProperties(xpart.getSerdeParameters())); partDesc.setLocation(xpart.getLocation()); partDesc.setInputFormat(xpart.getInputFormat()); partDesc.setOutputFormat(xpart.getOutputFormat()); partDesc.setSerializationLib(xpart.getSerdeClassname()); return partDesc; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { theNonTimePartitionSpec = this.getNonTimePartitionSpec(); strategy.appendField(locator, this, "nonTimePartitionSpec", buffer, theNonTimePartitionSpec);
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { theNonTimePartitionSpec = this.getNonTimePartitionSpec(); strategy.appendField(locator, this, "nonTimePartitionSpec", buffer, theNonTimePartitionSpec);
lhsNonTimePartitionSpec = this.getNonTimePartitionSpec(); XPartSpec rhsNonTimePartitionSpec; rhsNonTimePartitionSpec = that.getNonTimePartitionSpec(); if (!strategy.equals(LocatorUtils.property(thisLocator, "nonTimePartitionSpec", lhsNonTimePartitionSpec), LocatorUtils.property(thatLocator, "nonTimePartitionSpec", rhsNonTimePartitionSpec), lhsNonTimePartitionSpec, rhsNonTimePartitionSpec)) { return false;
lhsNonTimePartitionSpec = this.getNonTimePartitionSpec(); XPartSpec rhsNonTimePartitionSpec; rhsNonTimePartitionSpec = that.getNonTimePartitionSpec(); if (!strategy.equals(LocatorUtils.property(thisLocator, "nonTimePartitionSpec", lhsNonTimePartitionSpec), LocatorUtils.property(thatLocator, "nonTimePartitionSpec", rhsNonTimePartitionSpec), lhsNonTimePartitionSpec, rhsNonTimePartitionSpec)) { return false;
theNonTimePartitionSpec = this.getNonTimePartitionSpec(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "nonTimePartitionSpec", theNonTimePartitionSpec), currentHashCode, theNonTimePartitionSpec);
theNonTimePartitionSpec = this.getNonTimePartitionSpec(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "nonTimePartitionSpec", theNonTimePartitionSpec), currentHashCode, theNonTimePartitionSpec);