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

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

本文整理了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

  1. /**
  2. * @param viewExpandedText
  3. * the expanded view text to set
  4. */
  5. public void setViewExpandedText(String viewExpandedText) {
  6. tTable.setViewExpandedText(viewExpandedText);
  7. }

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

  1. /**
  2. * @param viewExpandedText
  3. * the expanded view text to set
  4. */
  5. public void setViewExpandedText(String viewExpandedText) {
  6. tTable.setViewExpandedText(viewExpandedText);
  7. }

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

  1. public static org.apache.hadoop.hive.metastore.api.Table toMetastoreApiTable(Table table, PrincipalPrivileges privileges)
  2. {
  3. org.apache.hadoop.hive.metastore.api.Table result = new org.apache.hadoop.hive.metastore.api.Table();
  4. result.setDbName(table.getDatabaseName());
  5. result.setTableName(table.getTableName());
  6. result.setOwner(table.getOwner());
  7. result.setTableType(table.getTableType());
  8. result.setParameters(table.getParameters());
  9. result.setPartitionKeys(table.getPartitionColumns().stream().map(ThriftMetastoreUtil::toMetastoreApiFieldSchema).collect(toList()));
  10. result.setSd(makeStorageDescriptor(table.getTableName(), table.getDataColumns(), table.getStorage()));
  11. result.setPrivileges(toMetastoreApiPrincipalPrivilegeSet(table.getOwner(), privileges));
  12. result.setViewOriginalText(table.getViewOriginalText().orElse(null));
  13. result.setViewExpandedText(table.getViewExpandedText().orElse(null));
  14. return result;
  15. }

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

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

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

  1. unsetViewExpandedText();
  2. } else {
  3. setViewExpandedText((String)value);

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

  1. /**
  2. * @param viewExpandedText
  3. * the expanded view text to set
  4. */
  5. public void setViewExpandedText(String viewExpandedText) {
  6. tTable.setViewExpandedText(viewExpandedText);
  7. }

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

  1. /**
  2. * @param viewExpandedText
  3. * the expanded view text to set
  4. */
  5. public void setViewExpandedText(String viewExpandedText) {
  6. tTable.setViewExpandedText(viewExpandedText);
  7. }

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

  1. private void validAndUpdateVirtualView(final Table table) {
  2. if (isVirtualView(table)
  3. && Strings.isNullOrEmpty(table.getViewOriginalText())) {
  4. throw new MetacatBadRequestException(
  5. String.format("Invalid view creation for %s/%s. Missing viewOrginialText",
  6. table.getDbName(),
  7. table.getDbName()));
  8. }
  9. if (Strings.isNullOrEmpty(table.getViewExpandedText())) {
  10. //set viewExpandedText to viewOriginalTest
  11. table.setViewExpandedText(table.getViewOriginalText());
  12. }
  13. //setting dummy string to view to avoid dropping view issue in hadoop Path org.apache.hadoop.fs
  14. if (Strings.isNullOrEmpty(table.getSd().getLocation())) {
  15. table.getSd().setLocation("file://tmp/" + table.getDbName() + "/" + table.getTableName());
  16. }
  17. }

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

  1. private void validAndUpdateVirtualView(final Table table) {
  2. if (isVirtualView(table)
  3. && Strings.isNullOrEmpty(table.getViewOriginalText())) {
  4. throw new MetacatBadRequestException(
  5. String.format("Invalid view creation for %s/%s. Missing viewOrginialText",
  6. table.getDbName(),
  7. table.getDbName()));
  8. }
  9. if (Strings.isNullOrEmpty(table.getViewExpandedText())) {
  10. //set viewExpandedText to viewOriginalTest
  11. table.setViewExpandedText(table.getViewOriginalText());
  12. }
  13. //setting dummy string to view to avoid dropping view issue in hadoop Path org.apache.hadoop.fs
  14. if (Strings.isNullOrEmpty(table.getSd().getLocation())) {
  15. table.getSd().setLocation("file://tmp/" + table.getDbName() + "/" + table.getTableName());
  16. }
  17. }

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

  1. private void updateTableTypeAndViewInfo(final TableDto dto, final Table table) {
  2. final ViewDto viewDto = dto.getView();
  3. if (null == dto.getView() || Strings.isNullOrEmpty(viewDto.getViewOriginalText())) {
  4. table.setTableType(TableType.EXTERNAL_TABLE.name());
  5. return;
  6. }
  7. table.setTableType(TableType.VIRTUAL_VIEW.name());
  8. table.setViewOriginalText(viewDto.getViewOriginalText());
  9. table.setViewExpandedText(viewDto.getViewExpandedText());
  10. }

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

  1. private void updateTableTypeAndViewInfo(final TableDto dto, final Table table) {
  2. final ViewDto viewDto = dto.getView();
  3. if (null == dto.getView() || Strings.isNullOrEmpty(viewDto.getViewOriginalText())) {
  4. table.setTableType(TableType.EXTERNAL_TABLE.name());
  5. return;
  6. }
  7. table.setTableType(TableType.VIRTUAL_VIEW.name());
  8. table.setViewOriginalText(viewDto.getViewOriginalText());
  9. table.setViewExpandedText(viewDto.getViewExpandedText());
  10. }

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

  1. public static org.apache.hadoop.hive.metastore.api.Table toMetastoreApiTable(Table table, PrincipalPrivileges privileges)
  2. {
  3. org.apache.hadoop.hive.metastore.api.Table result = new org.apache.hadoop.hive.metastore.api.Table();
  4. result.setDbName(table.getDatabaseName());
  5. result.setTableName(table.getTableName());
  6. result.setOwner(table.getOwner());
  7. result.setTableType(table.getTableType());
  8. result.setParameters(table.getParameters());
  9. result.setPartitionKeys(table.getPartitionColumns().stream().map(ThriftMetastoreUtil::toMetastoreApiFieldSchema).collect(toList()));
  10. result.setSd(makeStorageDescriptor(table.getTableName(), table.getDataColumns(), table.getStorage()));
  11. result.setPrivileges(toMetastoreApiPrincipalPrivilegeSet(privileges));
  12. result.setViewOriginalText(table.getViewOriginalText().orElse(null));
  13. result.setViewExpandedText(table.getViewExpandedText().orElse(null));
  14. return result;
  15. }

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

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

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

  1. @Override
  2. public Table transform(Table table) {
  3. if (!MetaStoreUtils.isView(table)) {
  4. return table;
  5. }
  6. LOG.info("Translating HQL of view {}.{}", table.getDbName(), table.getTableName());
  7. String tableQualifiedName = Warehouse.getQualifiedName(table);
  8. String hql = hqlTranslator.translate(tableQualifiedName, table.getViewOriginalText());
  9. String expandedHql = hqlTranslator.translate(tableQualifiedName, table.getViewExpandedText());
  10. Table transformedView = new Table(table);
  11. transformedView.setViewOriginalText(hql);
  12. transformedView.setViewExpandedText(expandedHql);
  13. if (!replicaHiveConf.getBoolean(SKIP_TABLE_EXIST_CHECKS, false)) {
  14. LOG
  15. .info("Validating that tables used by the view {}.{} exist in the replica catalog", table.getDbName(),
  16. table.getTableName());
  17. validateReferencedTables(transformedView);
  18. }
  19. return transformedView;
  20. }

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

  1. @Override
  2. public Table transform(Table table) {
  3. if (!MetaStoreUtils.isView(table)) {
  4. return table;
  5. }
  6. LOG.info("Translating HQL of view {}.{}", table.getDbName(), table.getTableName());
  7. String tableQualifiedName = Warehouse.getQualifiedName(table);
  8. String hql = hqlTranslator.translate(tableQualifiedName, table.getViewOriginalText());
  9. String expandedHql = hqlTranslator.translate(tableQualifiedName, table.getViewExpandedText());
  10. Table transformedView = new Table(table);
  11. transformedView.setViewOriginalText(hql);
  12. transformedView.setViewExpandedText(expandedHql);
  13. if (!replicaHiveConf.getBoolean(SKIP_TABLE_EXIST_CHECKS, false)) {
  14. LOG
  15. .info("Validating that tables used by the view {}.{} exist in the replica catalog", table.getDbName(),
  16. table.getTableName());
  17. validateReferencedTables(transformedView);
  18. }
  19. return transformedView;
  20. }

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

  1. unsetViewExpandedText();
  2. } else {
  3. setViewExpandedText((String)value);

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

  1. unsetViewExpandedText();
  2. } else {
  3. setViewExpandedText((String)value);

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

  1. unsetViewExpandedText();
  2. } else {
  3. setViewExpandedText((String)value);

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

  1. unsetViewExpandedText();
  2. } else {
  3. setViewExpandedText((String)value);

相关文章

Table类方法