Tabnine Logo
XTimePartSpecElement
Code IndexAdd Tabnine to your IDE (free)

How to use
XTimePartSpecElement
in
org.apache.lens.api.metastore

Best Java code snippets using org.apache.lens.api.metastore.XTimePartSpecElement (Showing top 20 results out of 315)

origin: org.apache.lens/lens-api

public XTimePartSpecElement withKey(String value) {
  setKey(value);
  return this;
}
origin: org.apache.lens/lens-api

public XTimePartSpecElement withValue(XMLGregorianCalendar value) {
  setValue(value);
  return this;
}
origin: org.apache.lens/lens-api

/**
 * Create an instance of {@link XTimePartSpecElement }
 * 
 */
public XTimePartSpecElement createXTimePartSpecElement() {
  return new XTimePartSpecElement();
}
origin: org.apache.lens/lens-api

public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
  {
    String theKey;
    theKey = this.getKey();
    strategy.appendField(locator, this, "key", buffer, theKey);
  }
  {
    XMLGregorianCalendar theValue;
    theValue = this.getValue();
    strategy.appendField(locator, this, "value", buffer, theValue);
  }
  return buffer;
}
origin: apache/lens

/**
 * Sets up query command instances and adds partitions to a table.
 * @throws Exception
 */
@BeforeClass
public void setup() throws Exception {
 LensClient client = new LensClient();
 LensCubeCommands command = new LensCubeCommands();
 command.setClient(client);
 log.debug("Starting to test cube commands");
 URL cubeSpec = TestLensQueryCommands.class.getClassLoader().getResource("schema/cubes/base/sample-cube.xml");
 command.createCube(new File(cubeSpec.toURI()));
 TestLensDimensionCommands.createDimension();
 TestLensDimensionTableCommands.addDim1Table("dim_table", "schema/dimtables/dim_table.xml", "local");
 // Add partition
 URL dataDir = TestLensQueryCommands.class.getClassLoader().getResource("dim2-part");
 XPartition xp = new XPartition();
 xp.setFactOrDimensionTableName("dim_table");
 xp.setLocation(new Path(dataDir.toURI()).toString());
 xp.setUpdatePeriod(XUpdatePeriod.HOURLY);
 XTimePartSpec timePart = new XTimePartSpec();
 XTimePartSpecElement partElement = new XTimePartSpecElement();
 partElement.setKey("dt");
 partElement.setValue(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
 timePart.getPartSpecElement().add(partElement);
 xp.setTimePartitionSpec(timePart);
 APIResult result = client.addPartitionToDim("dim_table", "local", xp);
 assertEquals(result.getStatus(), APIResult.Status.SUCCEEDED);
}
origin: apache/lens

private XTimePartSpecElement createTimePartSpecElement(Date partDate, String timeDimension) {
 XTimePartSpecElement timePart = cubeObjectFactory.createXTimePartSpecElement();
 timePart.setKey(timeDimension);
 timePart.setValue(JAXBUtils.getXMLGregorianCalendar(HOURLY.truncate(partDate)));
 return timePart;
}
origin: org.apache.lens/lens-api

public String toString() {
  final ToStringStrategy strategy = new YAMLToStringStrategy();
  final StringBuilder buffer = new StringBuilder();
  append(null, buffer, strategy);
  return buffer.toString();
}
origin: org.apache.lens/lens-cube

for (Map.Entry<String, String> entry : partSpec.entrySet()) {
 if (timePartCols.contains(entry.getKey())) {
  XTimePartSpecElement timePartSpecElement = new XTimePartSpecElement();
  timePartSpecElement.setKey(entry.getKey());
  timePartSpecElement
   .setValue(getXMLGregorianCalendar(UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).parse(
    entry.getValue())));
  xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpecElement);
origin: apache/lens

public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
  {
    String theKey;
    theKey = this.getKey();
    strategy.appendField(locator, this, "key", buffer, theKey);
  }
  {
    XMLGregorianCalendar theValue;
    theValue = this.getValue();
    strategy.appendField(locator, this, "value", buffer, theValue);
  }
  return buffer;
}
origin: apache/lens

timePartSpecElement1.setKey(timeDimensionPresentInPartitionOfAllFacts);
timePartSpecElement1.setValue(JAXBUtils.getXMLGregorianCalendar(currentDate));
timePartSpecElement2.setKey(timeDimOnlyPresentInPartitionOfFact1);
timePartSpecElement2.setValue(JAXBUtils.getXMLGregorianCalendar(expectedLatestDate));
origin: apache/lens

public String toString() {
  final ToStringStrategy strategy = new YAMLToStringStrategy();
  final StringBuilder buffer = new StringBuilder();
  append(null, buffer, strategy);
  return buffer.toString();
}
origin: apache/lens

for (Map.Entry<String, String> entry : partSpec.entrySet()) {
 if (timePartCols.contains(entry.getKey())) {
  XTimePartSpecElement timePartSpecElement = new XTimePartSpecElement();
  timePartSpecElement.setKey(entry.getKey());
  timePartSpecElement
   .setValue(getXMLGregorianCalendar(UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).parse(
    entry.getValue())));
  xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpecElement);
origin: org.apache.lens/lens-cube

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;
}
origin: apache/lens

public XTimePartSpecElement withValue(XMLGregorianCalendar value) {
  setValue(value);
  return this;
}
origin: apache/lens

public XTimePartSpecElement withKey(String value) {
  setKey(value);
  return this;
}
origin: apache/lens

/**
 * Create an instance of {@link XTimePartSpecElement }
 * 
 */
public XTimePartSpecElement createXTimePartSpecElement() {
  return new XTimePartSpecElement();
}
origin: apache/lens

xp.setUpdatePeriod(XUpdatePeriod.HOURLY);
XTimePartSpec timePart = new XTimePartSpec();
XTimePartSpecElement partElement = new XTimePartSpecElement();
partElement.setKey("dt");
partElement.setValue(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
timePart.getPartSpecElement().add(partElement);
xp.setTimePartitionSpec(timePart);
origin: apache/lens

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;
}
origin: org.apache.lens/lens-api

public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
  int currentHashCode = 1;
  {
    String theKey;
    theKey = this.getKey();
    currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "key", theKey), currentHashCode, theKey);
  }
  {
    XMLGregorianCalendar theValue;
    theValue = this.getValue();
    currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue);
  }
  return currentHashCode;
}
origin: apache/lens

public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
  int currentHashCode = 1;
  {
    String theKey;
    theKey = this.getKey();
    currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "key", theKey), currentHashCode, theKey);
  }
  {
    XMLGregorianCalendar theValue;
    theValue = this.getValue();
    currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue);
  }
  return currentHashCode;
}
org.apache.lens.api.metastoreXTimePartSpecElement

Javadoc

Time partition column name and its value as date-time.

Java class for x_time_part_spec_element complex type.

The following schema fragment specifies the expected content contained within this class.

 
<complexType name="x_time_part_spec_element"> 
<complexContent> 
<restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 
<attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 
<attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" /> 
</restriction> 
</complexContent> 
</complexType> 

Most used methods

  • setKey
    Sets the value of the key property.
  • setValue
    Sets the value of the value property.
  • <init>
  • getKey
    Gets the value of the key property.
  • getValue
    Gets the value of the value property.
  • append
  • appendFields
  • equals
  • hashCode

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now