Tabnine Logo
SortingProperty
Code IndexAdd Tabnine 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)

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

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Top 12 Jupyter Notebook extensions
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