private static ExprSpec[] exprSpecFromXExprColumn(Collection<XExprSpec> xesList) throws LensException { List<ExprSpec> esArray = new ArrayList<ExprSpec>(xesList.size()); for (XExprSpec xes : xesList) { esArray.add(new ExprSpec(xes.getExpr(), getDateFromXML(xes.getStartTime()), getDateFromXML(xes.getEndTime()))); } return esArray.toArray(new ExprSpec[0]); }
private static ExprSpec[] exprSpecFromXExprColumn(Collection<XExprSpec> xesList) throws LensException { List<ExprSpec> esArray = new ArrayList<ExprSpec>(xesList.size()); for (XExprSpec xes : xesList) { esArray.add(new ExprSpec(xes.getExpr(), getDateFromXML(xes.getStartTime()), getDateFromXML(xes.getEndTime()))); } return esArray.toArray(new ExprSpec[0]); }
public static Map<String, Date> timePartSpecfromXTimePartSpec( XTimePartSpec xtimePartSpec) { Map<String, Date> timePartSpec = new HashMap<String, Date>(); if (xtimePartSpec != null && !xtimePartSpec.getPartSpecElement().isEmpty()) { for (XTimePartSpecElement xtimePart : xtimePartSpec.getPartSpecElement()) { timePartSpec.put(xtimePart.getKey(), getDateFromXML(xtimePart.getValue())); } } return timePartSpec; }
public static Map<String, Date> timePartSpecfromXTimePartSpec( XTimePartSpec xtimePartSpec) { Map<String, Date> timePartSpec = new HashMap<String, Date>(); if (xtimePartSpec != null && !xtimePartSpec.getPartSpecElement().isEmpty()) { for (XTimePartSpecElement xtimePart : xtimePartSpec.getPartSpecElement()) { timePartSpec.put(xtimePart.getKey(), getDateFromXML(xtimePart.getValue())); } } return timePartSpec; }
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; } }
assertEquals(timePartSpec.getKey(), fullPartSpec.getKey()); assertEquals( UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).format(JAXBUtils.getDateFromXML(timePartSpec.getValue())), fullPartSpec.getValue()); DateTime date = target().path("metastore/cubes").path("testCube").path("latestdate")
Date startDate = getDateFromXML(xd.getStartTime()); Date endDate = getDateFromXML(xd.getEndTime());
XPartSpecElement fullPartSpec = postedPartition.getFullPartitionSpec().getPartSpecElement().iterator().next(); assertEquals(timePartSpec.getKey(), fullPartSpec.getKey()); assertEquals(UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).format(JAXBUtils.getDateFromXML( timePartSpec.getValue())), fullPartSpec.getValue());
Date startDate = getDateFromXML(xd.getStartTime()); Date endDate = getDateFromXML(xd.getEndTime());
XPartSpecElement fullPartSpec = readPartition.getFullPartitionSpec().getPartSpecElement().iterator().next(); assertEquals(timePartSpec.getKey(), fullPartSpec.getKey()); assertEquals(UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).format(JAXBUtils.getDateFromXML( timePartSpec.getValue())), fullPartSpec.getValue()); DateTime date =