本文整理汇总了Java中com.facebook.presto.spi.ConnectorTableLayout类的典型用法代码示例。如果您正苦于以下问题:Java ConnectorTableLayout类的具体用法?Java ConnectorTableLayout怎么用?Java ConnectorTableLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConnectorTableLayout类属于com.facebook.presto.spi包,在下文中一共展示了ConnectorTableLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
/**
* Return a list of table layouts that satisfy the given constraint.
* <p>
* For each layout, connectors must return an "unenforced constraint" representing the part of the constraint summary that isn't guaranteed by the layout.
*
* @param session session
* @param table table
* @param constraint constraint
* @param desiredColumns desired columns
*/
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
// get table name from ConnectorTableHandle
HDFSTableHandle hdfsTable = checkType(table, HDFSTableHandle.class, "table");
SchemaTableName tableName = hdfsTable.getSchemaTableName();
// create HDFSTableLayoutHandle
HDFSTableLayoutHandle tableLayout = metaDataQuery.getTableLayout(connectorId, tableName.getSchemaName(), tableName.getTableName()).orElse(null);
tableLayout.setPredicates(constraint.getSummary() != null ? Optional.of(constraint.getSummary()) : Optional.empty());
// ConnectorTableLayout layout = new ConnectorTableLayout(HDFSTableLayoutHandle)
ConnectorTableLayout layout = getTableLayout(session, tableLayout);
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:dbiir,项目名称:paraflow,代码行数:25,代码来源:HDFSMetadata.java
示例2: getTableLayout
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle handle)
{
// TODO add fiber and timestamp as new LocalProperty into ConnectorTableLayout ?
HDFSTableLayoutHandle layoutHandle = checkType(handle, HDFSTableLayoutHandle.class, "tableLayoutHandle");
return new ConnectorTableLayout(layoutHandle);
}
开发者ID:dbiir,项目名称:paraflow,代码行数:8,代码来源:HDFSMetadata.java
示例3: getTableLayout
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public ConnectorTableLayout getTableLayout(ConnectorSession connectorSession, ConnectorTableLayoutHandle connectorTableLayoutHandle)
{
RestConnectorTableLayoutHandle tableLayoutHandle = Types.checkType(connectorTableLayoutHandle, RestConnectorTableLayoutHandle.class, "tableLayoutHandle");
return new ConnectorTableLayout(tableLayoutHandle);
}
开发者ID:prestodb-rocks,项目名称:presto-rest,代码行数:8,代码来源:RestMetadata.java
示例4: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
KuduTableHandle tableHandle = checkType(table, KuduTableHandle.class, "tableHandle");
ConnectorTableLayout layout = new ConnectorTableLayout(new KuduTableLayoutHandle(tableHandle, constraint.getSummary()));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:trackingio,项目名称:presto-kudu,代码行数:8,代码来源:KuduMetadata.java
示例5: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
KafkaTableHandle handle = convertTableHandle(table);
ConnectorTableLayout layout = new ConnectorTableLayout(new KafkaTableLayoutHandle(handle));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:KafkaMetadata.java
示例6: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
ExampleTableHandle tableHandle = checkType(table, ExampleTableHandle.class, "table");
ConnectorTableLayout layout = new ConnectorTableLayout(new ExampleTableLayoutHandle(tableHandle));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:ExampleMetadata.java
示例7: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
RaptorTableHandle handle = checkType(table, RaptorTableHandle.class, "table");
ConnectorTableLayout layout = new ConnectorTableLayout(new RaptorTableLayoutHandle(handle, constraint.getSummary()));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:RaptorMetadata.java
示例8: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(
ConnectorSession session,
ConnectorTableHandle table,
Constraint<ColumnHandle> constraint,
Optional<Set<ColumnHandle>> desiredColumns)
{
RedisTableHandle tableHandle = convertTableHandle(table);
ConnectorTableLayout layout = new ConnectorTableLayout(new RedisTableLayoutHandle(tableHandle));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:14,代码来源:RedisMetadata.java
示例9: getTableLayout
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle handle)
{
RedisTableLayoutHandle layout = convertLayout(handle);
// tables in this connector have a single layout
return getTableLayouts(session, layout.getTable(), Constraint.<ColumnHandle>alwaysTrue(), Optional.empty())
.get(0)
.getTableLayout();
}
开发者ID:y-lan,项目名称:presto,代码行数:11,代码来源:RedisMetadata.java
示例10: getTableLayout
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle handle)
{
return new ConnectorTableLayout(
handle,
Optional.empty(),
TupleDomain.none(),
Optional.empty(),
Optional.empty(),
ImmutableList.of());
}
开发者ID:y-lan,项目名称:presto,代码行数:12,代码来源:BlackHoleMetadata.java
示例11: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
JmxTableHandle handle = checkType(table, JmxTableHandle.class, "table");
ConnectorTableLayout layout = new ConnectorTableLayout(new JmxTableLayoutHandle(handle, constraint.getSummary()));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:JmxMetadata.java
示例12: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
JdbcTableHandle tableHandle = checkType(table, JdbcTableHandle.class, "table");
ConnectorTableLayout layout = new ConnectorTableLayout(new JdbcTableLayoutHandle(tableHandle, constraint.getSummary()));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:JdbcMetadata.java
示例13: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
InformationSchemaTableHandle handle = checkType(table, InformationSchemaTableHandle.class, "table");
ConnectorTableLayout layout = new ConnectorTableLayout(new InformationSchemaTableLayoutHandle(handle, constraint.getSummary()));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:InformationSchemaMetadata.java
示例14: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
SystemTableHandle tableHandle = checkType(table, SystemTableHandle.class, "table");
ConnectorTableLayout layout = new ConnectorTableLayout(new SystemTableLayoutHandle(tableHandle.getConnectorId(), tableHandle, constraint.getSummary()));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:SystemTablesMetadata.java
示例15: TableLayout
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
public TableLayout(TableLayoutHandle handle, ConnectorTableLayout layout)
{
requireNonNull(handle, "handle is null");
requireNonNull(layout, "layout is null");
this.handle = handle;
this.layout = layout;
}
开发者ID:y-lan,项目名称:presto,代码行数:9,代码来源:TableLayout.java
示例16: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session,
ConnectorTableHandle table,
Constraint<ColumnHandle> constraint,
Optional<Set<ColumnHandle>> desiredColumns)
{
TpchTableHandle tableHandle = checkType(table, TpchTableHandle.class, "table");
Optional<Set<ColumnHandle>> partitioningColumns = Optional.empty();
List<LocalProperty<ColumnHandle>> localProperties = ImmutableList.of();
Map<String, ColumnHandle> columns = getColumnHandles(session, tableHandle);
if (tableHandle.getTableName().equals(TpchTable.ORDERS.getTableName())) {
partitioningColumns = Optional.of(ImmutableSet.of(columns.get(OrderColumn.ORDER_KEY.getColumnName())));
localProperties = ImmutableList.of(new SortingProperty<>(columns.get(OrderColumn.ORDER_KEY.getColumnName()), SortOrder.ASC_NULLS_FIRST));
}
else if (tableHandle.getTableName().equals(TpchTable.LINE_ITEM.getTableName())) {
partitioningColumns = Optional.of(ImmutableSet.of(columns.get(LineItemColumn.ORDER_KEY.getColumnName())));
localProperties = ImmutableList.of(
new SortingProperty<>(columns.get(LineItemColumn.ORDER_KEY.getColumnName()), SortOrder.ASC_NULLS_FIRST),
new SortingProperty<>(columns.get(LineItemColumn.LINE_NUMBER.getColumnName()), SortOrder.ASC_NULLS_FIRST));
}
ConnectorTableLayout layout = new ConnectorTableLayout(
new TpchTableLayoutHandle(tableHandle),
Optional.<List<ColumnHandle>>empty(),
TupleDomain.<ColumnHandle>all(), // TODO: return well-known properties (e.g., orderkey > 0, etc)
partitioningColumns,
Optional.empty(),
localProperties);
return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
开发者ID:y-lan,项目名称:presto,代码行数:34,代码来源:TpchMetadata.java
示例17: getTableLayout
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle handle)
{
TpchTableLayoutHandle layout = checkType(handle, TpchTableLayoutHandle.class, "layout");
// tables in this connector have a single layout
return getTableLayouts(session, layout.getTable(), Constraint.<ColumnHandle>alwaysTrue(), Optional.empty())
.get(0)
.getTableLayout();
}
开发者ID:y-lan,项目名称:presto,代码行数:11,代码来源:TpchMetadata.java
示例18: getTableLayout
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle handle)
{
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
return delegate.getTableLayout(session, handle);
}
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:ClassLoaderSafeConnectorMetadata.java
示例19: getTableLayouts
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
CassandraTableHandle handle = checkType(table, CassandraTableHandle.class, "table");
CassandraPartitionResult result = partitionManager.getPartitions(handle, constraint.getSummary());
ConnectorTableLayout layout = getTableLayout(session, new CassandraTableLayoutHandle(handle, result.getPartitions()));
return ImmutableList.of(new ConnectorTableLayoutResult(layout, result.getUnenforcedConstraint()));
}
开发者ID:y-lan,项目名称:presto,代码行数:9,代码来源:CassandraMetadata.java
示例20: getTableLayout
import com.facebook.presto.spi.ConnectorTableLayout; //导入依赖的package包/类
@Override
public ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle layoutHandle)
{
HiveTableLayoutHandle hiveLayoutHandle = checkType(layoutHandle, HiveTableLayoutHandle.class, "layoutHandle");
List<TupleDomain<ColumnHandle>> partitionDomains = hiveLayoutHandle.getPartitions().get().stream()
.map(HivePartition::getTupleDomain)
.collect(toList());
TupleDomain<ColumnHandle> predicate = TupleDomain.none();
if (!partitionDomains.isEmpty()) {
predicate = TupleDomain.columnWiseUnion(partitionDomains);
}
return new ConnectorTableLayout(hiveLayoutHandle, Optional.empty(), predicate, Optional.empty(), Optional.of(partitionDomains), ImmutableList.of());
}
开发者ID:y-lan,项目名称:presto,代码行数:15,代码来源:HiveMetadata.java
注:本文中的com.facebook.presto.spi.ConnectorTableLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论