本文整理了Java中org.apache.lens.api.metastore.XPartition.getTimePartitionSpec()
方法的一些代码示例,展示了XPartition.getTimePartitionSpec()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPartition.getTimePartitionSpec()
方法的具体详情如下:
包路径:org.apache.lens.api.metastore.XPartition
类名称:XPartition
方法名:getTimePartitionSpec
[英]Gets the value of the timePartitionSpec property.
[中]获取timePartitionSpec属性的值。
代码示例来源:origin: apache/lens
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;
}
}
代码示例来源:origin: org.apache.lens/lens-cube
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;
}
}
代码示例来源:origin: org.apache.lens/lens-cube
.setValue(getXMLGregorianCalendar(UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).parse(
entry.getValue())));
xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpecElement);
} else {
XPartSpecElement partSpecElement = new XPartSpecElement();
代码示例来源:origin: apache/lens
.setValue(getXMLGregorianCalendar(UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).parse(
entry.getValue())));
xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpecElement);
} else {
XPartSpecElement partSpecElement = new XPartSpecElement();
代码示例来源:origin: apache/lens
private XPartition createPartition(String cubeTableName, final List<XTimePartSpecElement>
timePartSpecs, String updatePeriod) {
XPartition xp = cubeObjectFactory.createXPartition();
xp.setLocation(new Path(new File("target").getAbsolutePath(), "part/test_part").toString());
xp.setFactOrDimensionTableName(cubeTableName);
xp.setNonTimePartitionSpec(new XPartSpec());
xp.setTimePartitionSpec(new XTimePartSpec());
xp.setPartitionParameters(new XProperties());
xp.setSerdeParameters(new XProperties());
for (XTimePartSpecElement timePartSpec : timePartSpecs) {
xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpec);
}
if (updatePeriod==null) {
xp.setUpdatePeriod(XUpdatePeriod.HOURLY);
} else {
XUpdatePeriod updatePeriod1=XUpdatePeriod.valueOf(updatePeriod.toUpperCase());
xp.setUpdatePeriod(updatePeriod1);
}
return xp;
}
代码示例来源:origin: apache/lens
XPartition readPartition = partitions.getPartition().get(0);
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();
XPartSpecElement fullPartSpec = readPartition.getFullPartitionSpec().getPartSpecElement().iterator().next();
assertEquals(timePartSpec.getKey(), fullPartSpec.getKey());
代码示例来源:origin: apache/lens
assertTrue(partitions.getPartition().get(0).getTimePartitionSpec() == null
|| partitions.getPartition().get(1).getTimePartitionSpec() == null);
XPartition postedPartition, latestPartition;
if (partitions.getPartition().get(0).getTimePartitionSpec() == null) {
postedPartition = partitions.getPartition().get(1);
latestPartition = partitions.getPartition().get(0);
assertEquals(postedPartition.getTimePartitionSpec(), xp.getTimePartitionSpec());
assertEquals(postedPartition.getNonTimePartitionSpec(), xp.getNonTimePartitionSpec());
assertNotNull(postedPartition.getFullPartitionSpec());
XTimePartSpecElement timePartSpec = postedPartition.getTimePartitionSpec().getPartSpecElement().iterator().next();
XPartSpecElement fullPartSpec = postedPartition.getFullPartitionSpec().getPartSpecElement().iterator().next();
assertEquals(timePartSpec.getKey(), fullPartSpec.getKey());
timePartSpec.getValue())), fullPartSpec.getValue());
assertNull(latestPartition.getTimePartitionSpec());
assertNull(latestPartition.getNonTimePartitionSpec());
assertEquals(latestPartition.getFullPartitionSpec().getPartSpecElement().get(0).getValue(),
代码示例来源:origin: apache/lens
xp2.getTimePartitionSpec().getPartSpecElement()
.add(createTimePartSpecElement(partDate, "non_existant_time_part"));
Response response = target().path("metastore/facts/").path(table).path("storages/S2/partition")
XPartition readPartition = partitions.getPartition().get(0);
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();
XPartSpecElement fullPartSpec = readPartition.getFullPartitionSpec().getPartSpecElement().iterator().next();
assertEquals(timePartSpec.getKey(), fullPartSpec.getKey());
代码示例来源:origin: org.apache.lens/lens-cube
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;
}
代码示例来源:origin: apache/lens
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;
}
代码示例来源:origin: org.apache.lens/lens-api
theTimePartitionSpec = this.getTimePartitionSpec();
strategy.appendField(locator, this, "timePartitionSpec", buffer, theTimePartitionSpec);
代码示例来源:origin: apache/lens
theTimePartitionSpec = this.getTimePartitionSpec();
strategy.appendField(locator, this, "timePartitionSpec", buffer, theTimePartitionSpec);
代码示例来源:origin: apache/lens
lhsTimePartitionSpec = this.getTimePartitionSpec();
XTimePartSpec rhsTimePartitionSpec;
rhsTimePartitionSpec = that.getTimePartitionSpec();
if (!strategy.equals(LocatorUtils.property(thisLocator, "timePartitionSpec", lhsTimePartitionSpec), LocatorUtils.property(thatLocator, "timePartitionSpec", rhsTimePartitionSpec), lhsTimePartitionSpec, rhsTimePartitionSpec)) {
return false;
代码示例来源:origin: org.apache.lens/lens-api
lhsTimePartitionSpec = this.getTimePartitionSpec();
XTimePartSpec rhsTimePartitionSpec;
rhsTimePartitionSpec = that.getTimePartitionSpec();
if (!strategy.equals(LocatorUtils.property(thisLocator, "timePartitionSpec", lhsTimePartitionSpec), LocatorUtils.property(thatLocator, "timePartitionSpec", rhsTimePartitionSpec), lhsTimePartitionSpec, rhsTimePartitionSpec)) {
return false;
代码示例来源:origin: apache/lens
theTimePartitionSpec = this.getTimePartitionSpec();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "timePartitionSpec", theTimePartitionSpec), currentHashCode, theTimePartitionSpec);
代码示例来源:origin: org.apache.lens/lens-api
theTimePartitionSpec = this.getTimePartitionSpec();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "timePartitionSpec", theTimePartitionSpec), currentHashCode, theTimePartitionSpec);
内容来源于网络,如有侵权,请联系作者删除!