Package io.druid.query.extraction

Examples of io.druid.query.extraction.DimExtractionFn


  @Test
  public void testQuarterExtraction()
  {
    Set<String> quarters = Sets.newHashSet();
    DimExtractionFn dimExtractionFn = new TimeDimExtractionFn("MM/dd/yyyy", "QQQ/yyyy");

    for (String dim : dims) {
      quarters.add(dimExtractionFn.apply(dim));
    }

    Assert.assertEquals(quarters.size(), 3);
    Assert.assertTrue(quarters.contains("Q1/2012"));
    Assert.assertTrue(quarters.contains("Q2/2012"));
View Full Code Here


  @Test
  public void testExtraction()
  {
    String regex = ".*[Tt][Oo].*";
    DimExtractionFn dimExtractionFn = new PartialDimExtractionFn(regex);
    List<String> expected = Arrays.asList("Quito", "Tokyo", "Stockholm", "Pretoria", "Wellington");
    Set<String> extracted = Sets.newHashSet();

    for (String str : testStrings) {
      String res = dimExtractionFn.apply(str);
      if (res != null) {
        extracted.add(res);
      }
    }

View Full Code Here

TOP

Related Classes of io.druid.query.extraction.DimExtractionFn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.