org.apache.hadoop.hive.metastore.api.Table.setViewExpandedText()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(137)

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

Table.setViewExpandedText介绍

暂无

代码示例

代码示例来源:origin: apache/hive

/**
 * @param viewExpandedText
 *          the expanded view text to set
 */
public void setViewExpandedText(String viewExpandedText) {
 tTable.setViewExpandedText(viewExpandedText);
}

代码示例来源:origin: apache/drill

/**
 * @param viewExpandedText
 *          the expanded view text to set
 */
public void setViewExpandedText(String viewExpandedText) {
 tTable.setViewExpandedText(viewExpandedText);
}

代码示例来源:origin: prestodb/presto

public static org.apache.hadoop.hive.metastore.api.Table toMetastoreApiTable(Table table, PrincipalPrivileges privileges)
{
  org.apache.hadoop.hive.metastore.api.Table result = new org.apache.hadoop.hive.metastore.api.Table();
  result.setDbName(table.getDatabaseName());
  result.setTableName(table.getTableName());
  result.setOwner(table.getOwner());
  result.setTableType(table.getTableType());
  result.setParameters(table.getParameters());
  result.setPartitionKeys(table.getPartitionColumns().stream().map(ThriftMetastoreUtil::toMetastoreApiFieldSchema).collect(toList()));
  result.setSd(makeStorageDescriptor(table.getTableName(), table.getDataColumns(), table.getStorage()));
  result.setPrivileges(toMetastoreApiPrincipalPrivilegeSet(table.getOwner(), privileges));
  result.setViewOriginalText(table.getViewOriginalText().orElse(null));
  result.setViewExpandedText(table.getViewExpandedText().orElse(null));
  return result;
}

代码示例来源:origin: apache/hive

view.setPartitionKeys(viewPartitionCols);
view.setViewOriginalText("SELECT income, name FROM " + tblName);
view.setViewExpandedText("SELECT `" + tblName + "`.`income`, `" + tblName +
  "`.`name` FROM `" + dbName + "`.`" + tblName + "`");
view.setRewriteEnabled(false);

代码示例来源:origin: apache/hive

unsetViewExpandedText();
} else {
 setViewExpandedText((String)value);

代码示例来源:origin: com.facebook.presto.hive/hive-apache

/**
 * @param viewExpandedText
 *          the expanded view text to set
 */
public void setViewExpandedText(String viewExpandedText) {
 tTable.setViewExpandedText(viewExpandedText);
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

/**
 * @param viewExpandedText
 *          the expanded view text to set
 */
public void setViewExpandedText(String viewExpandedText) {
 tTable.setViewExpandedText(viewExpandedText);
}

代码示例来源:origin: Netflix/metacat

private void validAndUpdateVirtualView(final Table table) {
  if (isVirtualView(table)
    && Strings.isNullOrEmpty(table.getViewOriginalText())) {
    throw new MetacatBadRequestException(
      String.format("Invalid view creation for %s/%s. Missing viewOrginialText",
        table.getDbName(),
        table.getDbName()));
  }
  if (Strings.isNullOrEmpty(table.getViewExpandedText())) {
    //set viewExpandedText to viewOriginalTest
    table.setViewExpandedText(table.getViewOriginalText());
  }
  //setting dummy string to view to avoid dropping view issue in hadoop Path org.apache.hadoop.fs
  if (Strings.isNullOrEmpty(table.getSd().getLocation())) {
    table.getSd().setLocation("file://tmp/" + table.getDbName() + "/" + table.getTableName());
  }
}

代码示例来源:origin: com.netflix.metacat/metacat-connector-hive

private void validAndUpdateVirtualView(final Table table) {
  if (isVirtualView(table)
    && Strings.isNullOrEmpty(table.getViewOriginalText())) {
    throw new MetacatBadRequestException(
      String.format("Invalid view creation for %s/%s. Missing viewOrginialText",
        table.getDbName(),
        table.getDbName()));
  }
  if (Strings.isNullOrEmpty(table.getViewExpandedText())) {
    //set viewExpandedText to viewOriginalTest
    table.setViewExpandedText(table.getViewOriginalText());
  }
  //setting dummy string to view to avoid dropping view issue in hadoop Path org.apache.hadoop.fs
  if (Strings.isNullOrEmpty(table.getSd().getLocation())) {
    table.getSd().setLocation("file://tmp/" + table.getDbName() + "/" + table.getTableName());
  }
}

代码示例来源:origin: Netflix/metacat

private void updateTableTypeAndViewInfo(final TableDto dto, final Table table) {
  final ViewDto viewDto = dto.getView();
  if (null == dto.getView() || Strings.isNullOrEmpty(viewDto.getViewOriginalText())) {
    table.setTableType(TableType.EXTERNAL_TABLE.name());
    return;
  }
  table.setTableType(TableType.VIRTUAL_VIEW.name());
  table.setViewOriginalText(viewDto.getViewOriginalText());
  table.setViewExpandedText(viewDto.getViewExpandedText());
}

代码示例来源:origin: com.netflix.metacat/metacat-thrift

private void updateTableTypeAndViewInfo(final TableDto dto, final Table table) {
  final ViewDto viewDto = dto.getView();
  if (null == dto.getView() || Strings.isNullOrEmpty(viewDto.getViewOriginalText())) {
    table.setTableType(TableType.EXTERNAL_TABLE.name());
    return;
  }
  table.setTableType(TableType.VIRTUAL_VIEW.name());
  table.setViewOriginalText(viewDto.getViewOriginalText());
  table.setViewExpandedText(viewDto.getViewExpandedText());
}

代码示例来源:origin: prestosql/presto

public static org.apache.hadoop.hive.metastore.api.Table toMetastoreApiTable(Table table, PrincipalPrivileges privileges)
{
  org.apache.hadoop.hive.metastore.api.Table result = new org.apache.hadoop.hive.metastore.api.Table();
  result.setDbName(table.getDatabaseName());
  result.setTableName(table.getTableName());
  result.setOwner(table.getOwner());
  result.setTableType(table.getTableType());
  result.setParameters(table.getParameters());
  result.setPartitionKeys(table.getPartitionColumns().stream().map(ThriftMetastoreUtil::toMetastoreApiFieldSchema).collect(toList()));
  result.setSd(makeStorageDescriptor(table.getTableName(), table.getDataColumns(), table.getStorage()));
  result.setPrivileges(toMetastoreApiPrincipalPrivilegeSet(privileges));
  result.setViewOriginalText(table.getViewOriginalText().orElse(null));
  result.setViewExpandedText(table.getViewExpandedText().orElse(null));
  return result;
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-hive

table.setParameters(properties);
table.setViewOriginalText(encodeViewData(viewData));
table.setViewExpandedText("/* Presto View */");
table.setSd(sd);

代码示例来源:origin: HotelsDotCom/circus-train

@Override
public Table transform(Table table) {
 if (!MetaStoreUtils.isView(table)) {
  return table;
 }
 LOG.info("Translating HQL of view {}.{}", table.getDbName(), table.getTableName());
 String tableQualifiedName = Warehouse.getQualifiedName(table);
 String hql = hqlTranslator.translate(tableQualifiedName, table.getViewOriginalText());
 String expandedHql = hqlTranslator.translate(tableQualifiedName, table.getViewExpandedText());
 Table transformedView = new Table(table);
 transformedView.setViewOriginalText(hql);
 transformedView.setViewExpandedText(expandedHql);
 if (!replicaHiveConf.getBoolean(SKIP_TABLE_EXIST_CHECKS, false)) {
  LOG
    .info("Validating that tables used by the view {}.{} exist in the replica catalog", table.getDbName(),
      table.getTableName());
  validateReferencedTables(transformedView);
 }
 return transformedView;
}

代码示例来源:origin: com.hotels/circus-train-hive-view

@Override
public Table transform(Table table) {
 if (!MetaStoreUtils.isView(table)) {
  return table;
 }
 LOG.info("Translating HQL of view {}.{}", table.getDbName(), table.getTableName());
 String tableQualifiedName = Warehouse.getQualifiedName(table);
 String hql = hqlTranslator.translate(tableQualifiedName, table.getViewOriginalText());
 String expandedHql = hqlTranslator.translate(tableQualifiedName, table.getViewExpandedText());
 Table transformedView = new Table(table);
 transformedView.setViewOriginalText(hql);
 transformedView.setViewExpandedText(expandedHql);
 if (!replicaHiveConf.getBoolean(SKIP_TABLE_EXIST_CHECKS, false)) {
  LOG
    .info("Validating that tables used by the view {}.{} exist in the replica catalog", table.getDbName(),
      table.getTableName());
  validateReferencedTables(transformedView);
 }
 return transformedView;
}

代码示例来源:origin: org.apache.hadoop.hive/hive-metastore

unsetViewExpandedText();
} else {
 setViewExpandedText((String)value);

代码示例来源:origin: com.facebook.presto.hive/hive-apache

unsetViewExpandedText();
} else {
 setViewExpandedText((String)value);

代码示例来源:origin: org.spark-project.hive/hive-metastore

unsetViewExpandedText();
} else {
 setViewExpandedText((String)value);

代码示例来源:origin: org.apache.hive/hive-standalone-metastore

unsetViewExpandedText();
} else {
 setViewExpandedText((String)value);

相关文章

Table类方法