congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
com.facebook.presto.spi
Code IndexAdd Tabnine to your IDE (free)

How to use com.facebook.presto.spi

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

origin: prestodb/presto

  @Override
  public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
  {
    return InMemoryRecordSet.builder(METADATA).build().cursor();
  }
}
origin: prestodb/presto

@Override
public long getSystemMemoryUsage()
{
  return cursor.getSystemMemoryUsage() + pageBuilder.getSizeInBytes();
}
origin: prestodb/presto

public int[] partitionPage(Page partitionColumns, Block bucketBlock)
{
  if (bucketBlock != null) {
    Block[] blocks = new Block[partitionColumns.getChannelCount() + 1];
    for (int i = 0; i < partitionColumns.getChannelCount(); i++) {
      blocks[i] = partitionColumns.getBlock(i);
    }
    blocks[blocks.length - 1] = bucketBlock;
    partitionColumns = new Page(partitionColumns.getPositionCount(), blocks);
  }
  return pageIndexer.indexPage(partitionColumns);
}
origin: prestodb/presto

private static Page extractColumns(Page page, int[] columns)
{
  Block[] blocks = new Block[columns.length];
  for (int i = 0; i < columns.length; i++) {
    int dataColumn = columns[i];
    blocks[i] = page.getBlock(dataColumn);
  }
  return new Page(page.getPositionCount(), blocks);
}
origin: prestodb/presto

  private static QueryId parseQueryId(String queryId)
  {
    try {
      return QueryId.valueOf(queryId);
    }
    catch (IllegalArgumentException e) {
      throw new PrestoException(INVALID_PROCEDURE_ARGUMENT, e);
    }
  }
}
origin: prestodb/presto

public static Builder builder(ConnectorTableMetadata tableMetadata)
{
  return builder(tableMetadata.getColumns());
}
origin: prestodb/presto

  private static void propagateIfUnhandled(PrestoException e)
      throws PrestoException
  {
    int errorCode = e.getErrorCode().getCode();
    if (errorCode == DIVISION_BY_ZERO.toErrorCode().getCode()
        || errorCode == INVALID_CAST_ARGUMENT.toErrorCode().getCode()
        || errorCode == INVALID_FUNCTION_ARGUMENT.toErrorCode().getCode()
        || errorCode == NUMERIC_VALUE_OUT_OF_RANGE.toErrorCode().getCode()) {
      return;
    }

    throw e;
  }
}
origin: prestodb/presto

  private static int totalRecords(RecordSet recordSet)
  {
    RecordCursor cursor = recordSet.cursor();
    int result = 0;
    while (cursor.advanceNextPosition()) {
      result++;
    }
    return result;
  }
}
origin: prestodb/presto

  private static int code(StandardErrorCode error)
  {
    return error.toErrorCode().getCode();
  }
}
origin: prestodb/presto

  @Override
  public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
  {
    return InMemoryRecordSet.builder(METADATA)
        .addRow("TABLE")
        .addRow("VIEW")
        .build().cursor();
  }
}
origin: prestodb/presto

  public long getRetainedSizeInBytes()
  {
    long retainedSizeInBytes = INSTANCE_SIZE;
    retainedSizeInBytes += pageBuilder.getRetainedSizeInBytes();
    for (Page page : outputQueue) {
      retainedSizeInBytes += page.getRetainedSizeInBytes();
    }
    return retainedSizeInBytes;
  }
}
origin: prestodb/presto

StandardErrorCode(int code, ErrorType type)
{
  errorCode = new ErrorCode(code, name(), type);
}
origin: prestodb/presto

@Override
public long getCompletedBytes()
{
  return delegate.getCompletedBytes();
}
origin: prestodb/presto

  public int getMaxIndex()
  {
    return pageIndexer.getMaxIndex();
  }
}
origin: prestodb/presto

  @Override
  public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
  {
    return InMemoryRecordSet.builder(METADATA).build().cursor();
  }
}
origin: prestodb/presto

  @Override
  public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
  {
    return InMemoryRecordSet.builder(METADATA).build().cursor();
  }
}
origin: prestodb/presto

  @Override
  public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
  {
    return InMemoryRecordSet.builder(METADATA).build().cursor();
  }
}
origin: prestodb/presto

  @Override
  public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
  {
    return InMemoryRecordSet.builder(METADATA).build().cursor();
  }
}
origin: prestodb/presto

  @Override
  public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
  {
    return InMemoryRecordSet.builder(METADATA).build().cursor();
  }
}
origin: prestodb/presto

  @Override
  public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint)
  {
    return InMemoryRecordSet.builder(METADATA).build().cursor();
  }
}
com.facebook.presto.spi

Most used classes

  • SchemaTableName
  • PrestoException
  • Type
  • VarcharType
  • TypeSignature
  • ConnectorTableMetadata,
  • TupleDomain,
  • Block,
  • BigintType,
  • BlockBuilder,
  • Constraint,
  • Page,
  • SchemaTablePrefix,
  • Domain,
  • ConnectorTableLayout,
  • ConnectorTableLayoutResult,
  • Range,
  • TypeManager,
  • ValueSet
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