Package io.druid.query.extraction

Examples of io.druid.query.extraction.RegexDimExtractionFn


        .setDimensions(
            Lists.<DimensionSpec>newArrayList(
                new ExtractionDimensionSpec(
                    "quality",
                    "alias",
                    new RegexDimExtractionFn("(\\w{1})")
                )
            )
        )
        .setAggregatorSpecs(
            Arrays.<AggregatorFactory>asList(
View Full Code Here


    TopNQuery query = new TopNQueryBuilder()
        .dataSource(QueryRunnerTestHelper.dataSource)
        .granularity(QueryRunnerTestHelper.allGran)
        .dimension(
            new ExtractionDimensionSpec(
                marketDimension, marketDimension, new RegexDimExtractionFn("(.)")
            )
        )
        .metric("rows")
        .threshold(4)
        .intervals(QueryRunnerTestHelper.firstToThird)
View Full Code Here

    TopNQuery query = new TopNQueryBuilder()
        .dataSource(QueryRunnerTestHelper.dataSource)
        .granularity(QueryRunnerTestHelper.allGran)
        .dimension(
            new ExtractionDimensionSpec(
                marketDimension, marketDimension, new RegexDimExtractionFn("(.)")
            )
        )
        .metric(new LexicographicTopNMetricSpec(null))
        .threshold(4)
        .intervals(QueryRunnerTestHelper.firstToThird)
View Full Code Here

    TopNQuery query = new TopNQueryBuilder()
        .dataSource(QueryRunnerTestHelper.dataSource)
        .granularity(QueryRunnerTestHelper.allGran)
        .dimension(
            new ExtractionDimensionSpec(
                marketDimension, marketDimension, new RegexDimExtractionFn("..(.)")
            )
        )
        .metric(new InvertedTopNMetricSpec(new LexicographicTopNMetricSpec(null)))
        .threshold(4)
        .intervals(QueryRunnerTestHelper.firstToThird)
View Full Code Here

    TopNQuery query = new TopNQueryBuilder()
        .dataSource(QueryRunnerTestHelper.dataSource)
        .granularity(QueryRunnerTestHelper.allGran)
        .dimension(
            new ExtractionDimensionSpec(
                marketDimension, marketDimension, new RegexDimExtractionFn("(.)")
            )
        )
        .metric(new LexicographicTopNMetricSpec("spot"))
        .threshold(4)
        .intervals(QueryRunnerTestHelper.firstToThird)
View Full Code Here

    TopNQuery query = new TopNQueryBuilder()
        .dataSource(QueryRunnerTestHelper.dataSource)
        .granularity(QueryRunnerTestHelper.allGran)
        .dimension(
            new ExtractionDimensionSpec(
                marketDimension, marketDimension, new RegexDimExtractionFn("(.)")
            )
        )
        .metric(new InvertedTopNMetricSpec(new LexicographicTopNMetricSpec("u")))
        .threshold(4)
        .intervals(QueryRunnerTestHelper.firstToThird)
View Full Code Here

    TopNQuery query = new TopNQueryBuilder()
        .dataSource(QueryRunnerTestHelper.dataSource)
        .granularity(QueryRunnerTestHelper.allGran)
        .dimension(
            new ExtractionDimensionSpec(
                marketDimension, marketDimension, new RegexDimExtractionFn("..(.)")
            )
        )
        .metric(new InvertedTopNMetricSpec(new LexicographicTopNMetricSpec("p")))
        .threshold(4)
        .intervals(QueryRunnerTestHelper.firstToThird)
View Full Code Here

  @Test
  public void testPathExtraction()
  {
    String regex = "/([^/]+)/";
    DimExtractionFn dimExtractionFn = new RegexDimExtractionFn(regex);
    Set<String> extracted = Sets.newHashSet();

    for (String path : paths) {
      extracted.add(dimExtractionFn.apply(path));
    }

    Assert.assertEquals(2, extracted.size());
    Assert.assertTrue(extracted.contains("druid"));
    Assert.assertTrue(extracted.contains("dash"));
View Full Code Here

  @Test
  public void testDeeperPathExtraction()
  {
    String regex = "^/([^/]+/[^/]+)(/|$)";
    DimExtractionFn dimExtractionFn = new RegexDimExtractionFn(regex);
    Set<String> extracted = Sets.newHashSet();

    for (String path : paths) {
      extracted.add(dimExtractionFn.apply(path));
    }

    Assert.assertEquals(4, extracted.size());
    Assert.assertTrue(extracted.contains("druid/prod"));
    Assert.assertTrue(extracted.contains("druid/demo"));
View Full Code Here

  @Test
  public void testStringExtraction()
  {
    String regex = "(.)";
    DimExtractionFn dimExtractionFn = new RegexDimExtractionFn(regex);
    Set<String> extracted = Sets.newHashSet();

    for (String testString : testStrings) {
      extracted.add(dimExtractionFn.apply(testString));
    }

    Assert.assertEquals(3, extracted.size());
    Assert.assertTrue(extracted.contains("a"));
    Assert.assertTrue(extracted.contains("b"));
View Full Code Here

TOP

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

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.