Tabnine Logo
OrderByColumnSpec.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.druid.query.groupby.orderby.OrderByColumnSpec
constructor

Best Java code snippets using org.apache.druid.query.groupby.orderby.OrderByColumnSpec.<init> (Showing top 20 results out of 315)

origin: apache/incubator-druid

public static OrderByColumnSpec asc(String dimension)
{
 return new OrderByColumnSpec(dimension, Direction.ASCENDING, null);
}
origin: apache/incubator-druid

public static OrderByColumnSpec desc(String dimension)
{
 return new OrderByColumnSpec(dimension, Direction.DESCENDING, null);
}
origin: apache/incubator-druid

@JsonCreator
public static OrderByColumnSpec fromString(String dimension)
{
 return new OrderByColumnSpec(dimension, null, null);
}
origin: apache/incubator-druid

public Builder addOrderByColumn(String dimension, OrderByColumnSpec.Direction direction)
{
 return addOrderByColumn(new OrderByColumnSpec(dimension, direction));
}
origin: apache/incubator-druid

@Test
public void testWithAllGranularity()
{
 DefaultLimitSpec limitSpec = new DefaultLimitSpec(
   ImmutableList.of(new OrderByColumnSpec("k1", OrderByColumnSpec.Direction.ASCENDING, StringComparators.NUMERIC)),
   2
 );
 Function<Sequence<Row>, Sequence<Row>> limitFn = limitSpec.build(
   ImmutableList.of(new DefaultDimensionSpec("k1", "k1", ValueType.DOUBLE)),
   ImmutableList.of(),
   ImmutableList.of(),
   Granularities.ALL,
   true
 );
 Assert.assertEquals(
   ImmutableList.of(testRowsList.get(0), testRowsList.get(1)),
   limitFn.apply(testRowsSequence).toList()
 );
}
origin: apache/incubator-druid

@Test
public void testWithSortByDimsFirst()
{
 DefaultLimitSpec limitSpec = new DefaultLimitSpec(
   ImmutableList.of(new OrderByColumnSpec("k1", OrderByColumnSpec.Direction.ASCENDING, StringComparators.NUMERIC)),
   2
 );
 Function<Sequence<Row>, Sequence<Row>> limitFn = limitSpec.build(
   ImmutableList.of(new DefaultDimensionSpec("k1", "k1", ValueType.DOUBLE)),
   ImmutableList.of(),
   ImmutableList.of(),
   Granularities.NONE,
   true
 );
 Assert.assertEquals(
   ImmutableList.of(testRowsList.get(2), testRowsList.get(0)),
   limitFn.apply(testRowsSequence).toList()
 );
}
origin: apache/incubator-druid

@Test
public void testSortDimensionDescending()
{
 DefaultLimitSpec limitSpec = new DefaultLimitSpec(
   ImmutableList.of(new OrderByColumnSpec("k1", OrderByColumnSpec.Direction.DESCENDING)),
   2
 );
 Function<Sequence<Row>, Sequence<Row>> limitFn = limitSpec.build(
   ImmutableList.of(new DefaultDimensionSpec("k1", "k1")),
   ImmutableList.of(),
   ImmutableList.of(),
   Granularities.NONE,
   false
 );
 // Note: This test encodes the fact that limitSpec sorts numbers like strings; we might want to change this
 // in the future.
 Assert.assertEquals(
   ImmutableList.of(testRowsList.get(2), testRowsList.get(1)),
   limitFn.apply(testRowsSequence).toList()
 );
}
origin: apache/incubator-druid

Collections.singletonList(new OrderByColumnSpec("rows", OrderByColumnSpec.Direction.DESCENDING)),
origin: apache/incubator-druid

@Test
public void testQuerySerialization() throws IOException
{
 Query query = GroupByQuery
   .builder()
   .setDataSource(QueryRunnerTestHelper.dataSource)
   .setQuerySegmentSpec(QueryRunnerTestHelper.firstToThird)
   .setDimensions(new DefaultDimensionSpec("quality", "alias"))
   .setAggregatorSpecs(QueryRunnerTestHelper.rowsCount, new LongSumAggregatorFactory("idx", "index"))
   .setGranularity(QueryRunnerTestHelper.dayGran)
   .setPostAggregatorSpecs(ImmutableList.of(new FieldAccessPostAggregator("x", "idx")))
   .setLimitSpec(
     new DefaultLimitSpec(
       ImmutableList.of(new OrderByColumnSpec(
         "alias",
         OrderByColumnSpec.Direction.ASCENDING,
         StringComparators.LEXICOGRAPHIC
       )),
       100
     )
   )
   .build();
 String json = jsonMapper.writeValueAsString(query);
 Query serdeQuery = jsonMapper.readValue(json, Query.class);
 Assert.assertEquals(query, serdeQuery);
}
origin: apache/incubator-druid

new DefaultLimitSpec(
  ImmutableList.of(
    new OrderByColumnSpec(
      "d0",
      OrderByColumnSpec.Direction.DESCENDING,
origin: apache/incubator-druid

@Test
public void testRejectForceLimitPushDownWithHaving()
{
 expectedException.expect(IAE.class);
 expectedException.expectMessage("Cannot force limit push down when a having spec is present.");
 GroupByQuery
   .builder()
   .setDataSource(QueryRunnerTestHelper.dataSource)
   .setGranularity(QueryRunnerTestHelper.allGran)
   .setDimensions(new DefaultDimensionSpec(QueryRunnerTestHelper.marketDimension, "marketalias"))
   .setInterval(QueryRunnerTestHelper.fullOnIntervalSpec)
   .setLimitSpec(
     new DefaultLimitSpec(
       Collections.singletonList(new OrderByColumnSpec("marketalias", OrderByColumnSpec.Direction.DESCENDING)),
       2
     )
   )
   .setAggregatorSpecs(QueryRunnerTestHelper.rowsCount)
   .setContext(ImmutableMap.of(GroupByQueryConfig.CTX_KEY_FORCE_LIMIT_PUSH_DOWN, true))
   .setHavingSpec(new GreaterThanHavingSpec("rows", 10))
   .build();
}
origin: apache/incubator-druid

.setLimitSpec(
  new DefaultLimitSpec(
    Collections.singletonList(new OrderByColumnSpec(
      "constant",
      OrderByColumnSpec.Direction.DESCENDING
origin: apache/incubator-druid

new DefaultLimitSpec(
  Collections.singletonList(
    new OrderByColumnSpec(QueryRunnerTestHelper.marketDimension, OrderByColumnSpec.Direction.DESCENDING)
  ),
origin: apache/incubator-druid

new DefaultLimitSpec(
  ImmutableList.of(
    new OrderByColumnSpec(
      "d0",
      OrderByColumnSpec.Direction.ASCENDING,
origin: apache/incubator-druid

new DefaultLimitSpec(
  Collections.singletonList(
    new OrderByColumnSpec("a0", Direction.ASCENDING, StringComparators.NUMERIC)
  ),
  Integer.MAX_VALUE
origin: apache/incubator-druid

new DefaultLimitSpec(
  ImmutableList.of(
    new OrderByColumnSpec(
      "d0",
      OrderByColumnSpec.Direction.ASCENDING,
origin: apache/incubator-druid

new DefaultLimitSpec(
  Collections.singletonList(
    new OrderByColumnSpec("a0", Direction.ASCENDING, StringComparators.NUMERIC)
  ),
  Integer.MAX_VALUE
origin: apache/incubator-druid

new DefaultLimitSpec(
  ImmutableList.of(
    new OrderByColumnSpec("d1", OrderByColumnSpec.Direction.ASCENDING)
  ),
origin: apache/incubator-druid

.setLimitSpec(
  new DefaultLimitSpec(
    Collections.singletonList(new OrderByColumnSpec(
      "alias",
      OrderByColumnSpec.Direction.DESCENDING
origin: apache/incubator-druid

.setLimitSpec(
  new DefaultLimitSpec(
    ImmutableList.of(new OrderByColumnSpec("alias", OrderByColumnSpec.Direction.ASCENDING)),
    null
org.apache.druid.query.groupby.orderbyOrderByColumnSpec<init>

Popular methods of OrderByColumnSpec

  • getDimension
  • getDimensionComparator
  • getDirection
  • asc
  • ascending
  • desc
  • descending
  • getAggIndexForOrderBy
  • getCacheKey
  • getDimIndexForOrderBy
  • getOrderByForDimName
  • getPostAggIndexForOrderBy
  • getOrderByForDimName,
  • getPostAggIndexForOrderBy

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JCheckBox (javax.swing)
  • Best plugins for Eclipse
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