Codota Logo
SortingProperty
Code IndexAdd Codota to your IDE (free)

How to use
SortingProperty
in
com.facebook.presto.spi

Best Java code snippets using com.facebook.presto.spi.SortingProperty (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: prestodb/presto

/**
 * Returns Optional.empty() if the column could not be translated
 */
@Override
public <T> Optional<LocalProperty<T>> translate(Function<E, Optional<T>> translator)
{
  return translator.apply(column)
      .map(translated -> new SortingProperty<>(translated, order));
}
origin: prestodb/presto

private static SortingProperty<String> sorted(String column, SortOrder order)
{
  return new SortingProperty<>(column, order);
}
origin: prestodb/presto

public Builder sorted(String column, SortOrder order)
{
  properties.add(new SortingProperty<>(column, order));
  return this;
}
origin: prestodb/presto

private static SortingProperty<Symbol> sorted(String column, SortOrder order)
{
  return new SortingProperty<>(symbol(column), order);
}
origin: prestodb/presto

@Override
public ActualProperties visitTopNRowNumber(TopNRowNumberNode node, List<ActualProperties> inputProperties)
{
  ActualProperties properties = Iterables.getOnlyElement(inputProperties);
  ImmutableList.Builder<LocalProperty<Symbol>> localProperties = ImmutableList.builder();
  localProperties.add(new GroupingProperty<>(node.getPartitionBy()));
  for (Symbol column : node.getOrderingScheme().getOrderBy()) {
    localProperties.add(new SortingProperty<>(column, node.getOrderingScheme().getOrdering(column)));
  }
  return ActualProperties.builderFrom(properties)
      .local(localProperties.build())
      .build();
}
origin: prestodb/presto

@Override
public ActualProperties visitTopN(TopNNode node, List<ActualProperties> inputProperties)
{
  ActualProperties properties = Iterables.getOnlyElement(inputProperties);
  List<SortingProperty<Symbol>> localProperties = node.getOrderingScheme().getOrderBy().stream()
      .map(column -> new SortingProperty<>(column, node.getOrderingScheme().getOrdering(column)))
      .collect(toImmutableList());
  return ActualProperties.builderFrom(properties)
      .local(localProperties)
      .build();
}
origin: prestodb/presto

@Override
public ActualProperties visitSort(SortNode node, List<ActualProperties> inputProperties)
{
  ActualProperties properties = Iterables.getOnlyElement(inputProperties);
  List<SortingProperty<Symbol>> localProperties = node.getOrderingScheme().getOrderBy().stream()
      .map(column -> new SortingProperty<>(column, node.getOrderingScheme().getOrdering(column)))
      .collect(toImmutableList());
  return ActualProperties.builderFrom(properties)
      .local(localProperties)
      .build();
}
origin: prestodb/presto

@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
  MongoTableHandle tableHandle = (MongoTableHandle) table;
  Optional<Set<ColumnHandle>> partitioningColumns = Optional.empty(); //TODO: sharding key
  ImmutableList.Builder<LocalProperty<ColumnHandle>> localProperties = ImmutableList.builder();
  MongoTable tableInfo = mongoSession.getTable(tableHandle.getSchemaTableName());
  Map<String, ColumnHandle> columns = getColumnHandles(session, tableHandle);
  for (MongoIndex index : tableInfo.getIndexes()) {
    for (MongodbIndexKey key : index.getKeys()) {
      if (!key.getSortOrder().isPresent()) {
        continue;
      }
      if (columns.get(key.getName()) != null) {
        localProperties.add(new SortingProperty<>(columns.get(key.getName()), key.getSortOrder().get()));
      }
    }
  }
  ConnectorTableLayout layout = new ConnectorTableLayout(
      new MongoTableLayoutHandle(tableHandle, constraint.getSummary()),
      Optional.empty(),
      TupleDomain.all(),
      Optional.empty(),
      partitioningColumns,
      Optional.empty(),
      localProperties.build());
  return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
origin: prestodb/presto

.map(column -> new SortingProperty<>(column, scheme.getOrdering(column)))
.forEach(localProperties::add));
origin: prestodb/presto

@Test
public void testJsonSerialization()
    throws Exception
{
  ObjectMapper mapper = new ObjectMapperProvider().get()
      .registerModule(new SimpleModule()
          .addDeserializer(ColumnHandle.class, new JsonDeserializer<ColumnHandle>()
          {
            @Override
            public ColumnHandle deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
                throws IOException
            {
              return new ObjectMapperProvider().get().readValue(jsonParser, TestingColumnHandle.class);
            }
          }));
  TestingColumnHandle columnHandle = new TestingColumnHandle("a");
  LocalProperty<ColumnHandle> property1 = new ConstantProperty<>(columnHandle);
  assertEquals(property1, mapper.readValue(mapper.writeValueAsString(property1), new TypeReference<LocalProperty<ColumnHandle>>() {}));
  LocalProperty<ColumnHandle> property2 = new SortingProperty<>(columnHandle, SortOrder.ASC_NULLS_FIRST);
  assertEquals(property2, mapper.readValue(mapper.writeValueAsString(property2), new TypeReference<LocalProperty<ColumnHandle>>() {}));
  LocalProperty<ColumnHandle> property3 = new GroupingProperty<>(ImmutableList.of(columnHandle));
  assertEquals(property3, mapper.readValue(mapper.writeValueAsString(property3), new TypeReference<LocalProperty<ColumnHandle>>() {}));
}
origin: prestodb/presto

        .map(symbol -> new SortingProperty<>(symbol, orderingScheme.getOrdering(symbol)))
        .forEach(desiredProperties::add));
Iterator<Optional<LocalProperty<Symbol>>> matchIterator = LocalProperties.match(child.getProperties().getLocalProperties(), desiredProperties).iterator();
origin: prestodb/presto

    ImmutableList.of(orderKeyColumn)));
partitioningColumns = Optional.of(ImmutableSet.of(orderKeyColumn));
localProperties = ImmutableList.of(new SortingProperty<>(orderKeyColumn, SortOrder.ASC_NULLS_FIRST));
partitioningColumns = Optional.of(ImmutableSet.of(orderKeyColumn));
localProperties = ImmutableList.of(
    new SortingProperty<>(orderKeyColumn, SortOrder.ASC_NULLS_FIRST),
    new SortingProperty<>(columns.get(columnNaming.getName(LineItemColumn.LINE_NUMBER)), SortOrder.ASC_NULLS_FIRST));
origin: prestodb/presto

if (node.getOrderingScheme().isPresent()) {
  node.getOrderingScheme().get().getOrderBy().stream()
      .map(column -> new SortingProperty<>(column, node.getOrderingScheme().get().getOrdering(column)))
      .forEach(localProperties::add);
origin: prestodb/presto

@Override
public PlanWithProperties visitWindow(WindowNode node, PreferredProperties preferredProperties)
{
  List<LocalProperty<Symbol>> desiredProperties = new ArrayList<>();
  if (!node.getPartitionBy().isEmpty()) {
    desiredProperties.add(new GroupingProperty<>(node.getPartitionBy()));
  }
  node.getOrderingScheme().ifPresent(orderingScheme ->
      orderingScheme.getOrderBy().stream()
          .map(symbol -> new SortingProperty<>(symbol, orderingScheme.getOrdering(symbol)))
          .forEach(desiredProperties::add));
  PlanWithProperties child = planChild(
      node,
      PreferredProperties.partitionedWithLocal(ImmutableSet.copyOf(node.getPartitionBy()), desiredProperties)
          .mergeWithParent(preferredProperties));
  if (!child.getProperties().isStreamPartitionedOn(node.getPartitionBy()) &&
      !child.getProperties().isNodePartitionedOn(node.getPartitionBy())) {
    if (node.getPartitionBy().isEmpty()) {
      child = withDerivedProperties(
          gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
          child.getProperties());
    }
    else {
      child = withDerivedProperties(
          partitionedExchange(idAllocator.getNextId(), REMOTE, child.getNode(), node.getPartitionBy(), node.getHashSymbol()),
          child.getProperties());
    }
  }
  return rebaseAndDeriveProperties(node, child);
}
origin: prestodb/presto

desiredProperties.add(new SortingProperty<>(symbol, node.getOrderingScheme().getOrdering(symbol)));
origin: com.facebook.presto/presto-spi

/**
 * Returns Optional.empty() if the column could not be translated
 */
@Override
public <T> Optional<LocalProperty<T>> translate(Function<E, Optional<T>> translator)
{
  return translator.apply(column)
      .map(translated -> new SortingProperty<>(translated, order));
}
origin: uk.co.nichesolutions.presto/presto-main

private static SortingProperty<String> sorted(String column, SortOrder order)
{
  return new SortingProperty<>(column, order);
}
origin: uk.co.nichesolutions.presto/presto-main

public Builder sorted(String column, SortOrder order)
{
  properties.add(new SortingProperty<>(column, order));
  return this;
}
origin: uk.co.nichesolutions.presto/presto-main

@Override
public ActualProperties visitSort(SortNode node, List<ActualProperties> inputProperties)
{
  ActualProperties properties = Iterables.getOnlyElement(inputProperties);
  List<SortingProperty<Symbol>> localProperties = node.getOrderBy().stream()
      .map(column -> new SortingProperty<>(column, node.getOrderings().get(column)))
      .collect(toImmutableList());
  return ActualProperties.builderFrom(properties)
      .local(localProperties)
      .build();
}
origin: uk.co.nichesolutions.presto/presto-main

@Override
public ActualProperties visitTopN(TopNNode node, List<ActualProperties> inputProperties)
{
  ActualProperties properties = Iterables.getOnlyElement(inputProperties);
  List<SortingProperty<Symbol>> localProperties = node.getOrderBy().stream()
      .map(column -> new SortingProperty<>(column, node.getOrderings().get(column)))
      .collect(toImmutableList());
  return ActualProperties.builderFrom(properties)
      .local(localProperties)
      .build();
}
com.facebook.presto.spiSortingProperty

Most used methods

  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now