com.facebook.presto.metadata.Metadata.getNewTableLayout()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中com.facebook.presto.metadata.Metadata.getNewTableLayout()方法的一些代码示例,展示了Metadata.getNewTableLayout()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metadata.getNewTableLayout()方法的具体详情如下:
包路径:com.facebook.presto.metadata.Metadata
类名称:Metadata
方法名:getNewTableLayout

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);
}

相关文章