本文整理了Java中com.facebook.presto.metadata.Metadata.getNewTableLayout()
方法的一些代码示例,展示了Metadata.getNewTableLayout()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metadata.getNewTableLayout()
方法的具体详情如下:
包路径:com.facebook.presto.metadata.Metadata
类名称:Metadata
方法名:getNewTableLayout
暂无
代码示例来源:origin: prestodb/presto
private RelationPlan createTableCreationPlan(Analysis analysis, Query query)
{
QualifiedObjectName destination = analysis.getCreateTableDestination().get();
RelationPlan plan = createRelationPlan(analysis, query);
ConnectorTableMetadata tableMetadata = createTableMetadata(
destination,
getOutputTableColumns(plan, analysis.getColumnAliases()),
analysis.getCreateTableProperties(),
analysis.getParameters(),
analysis.getCreateTableComment());
Optional<NewTableLayout> newTableLayout = metadata.getNewTableLayout(session, destination.getCatalogName(), tableMetadata);
List<String> columnNames = tableMetadata.getColumns().stream()
.filter(column -> !column.isHidden())
.map(ColumnMetadata::getName)
.collect(toImmutableList());
TableStatisticsMetadata statisticsMetadata = metadata.getStatisticsCollectionMetadata(session, destination.getCatalogName(), tableMetadata);
return createTableWriterPlan(
analysis,
plan,
new CreateName(destination.getCatalogName(), tableMetadata, newTableLayout),
columnNames,
newTableLayout,
statisticsMetadata);
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-main
private RelationPlan createTableCreationPlan(Analysis analysis, Query query)
{
QualifiedObjectName destination = analysis.getCreateTableDestination().get();
RelationPlan plan = createRelationPlan(analysis, query);
TableMetadata tableMetadata = createTableMetadata(destination, getOutputTableColumns(plan), analysis.getCreateTableProperties(), plan.getSampleWeight().isPresent());
if (plan.getSampleWeight().isPresent() && !metadata.canCreateSampledTables(session, destination.getCatalogName())) {
throw new PrestoException(NOT_SUPPORTED, "Cannot write sampled data to a store that doesn't support sampling");
}
Optional<NewTableLayout> newTableLayout = metadata.getNewTableLayout(session, destination.getCatalogName(), tableMetadata);
return createTableWriterPlan(
analysis,
plan,
new CreateName(destination.getCatalogName(), tableMetadata, newTableLayout),
tableMetadata.getVisibleColumnNames(),
newTableLayout);
}
内容来源于网络,如有侵权,请联系作者删除!