public boolean isMaterializedView() { return table.isMaterializedView(); }
public boolean isMaterializedView() { return table.isMaterializedView(); } }
public TYPE getDescType() { if (table.isView() || table.isMaterializedView()) { return TYPE.VIEW; } return TYPE.TABLE; }
@Override public void run() { for (Table table : tables) { if (table.isMaterializedView()) { addMaterializedView(table); } } } }
public TYPE getTableType() { if (table.isView() || table.isMaterializedView()) { return TYPE.VIEW; } return TYPE.TABLE; }
public static String getTableInformation(Table table, boolean isOutputPadded) { StringBuilder tableInfo = new StringBuilder(DEFAULT_STRINGBUILDER_SIZE); // Table Metadata tableInfo.append(LINE_DELIM).append("# Detailed Table Information").append(LINE_DELIM); getTableMetaDataInformation(tableInfo, table, isOutputPadded); // Storage information. tableInfo.append(LINE_DELIM).append("# Storage Information").append(LINE_DELIM); getStorageDescriptorInfo(tableInfo, table.getTTable().getSd()); if (table.isView() || table.isMaterializedView()) { tableInfo.append(LINE_DELIM).append(table.isView() ? "# View Information" : "# Materialized View Information").append(LINE_DELIM); getViewInfo(tableInfo, table); } return tableInfo.toString(); }
public static String getTableInformation(Table table, boolean isOutputPadded) { StringBuilder tableInfo = new StringBuilder(DEFAULT_STRINGBUILDER_SIZE); // Table Metadata tableInfo.append(LINE_DELIM).append("# Detailed Table Information").append(LINE_DELIM); getTableMetaDataInformation(tableInfo, table, isOutputPadded); // Storage information. tableInfo.append(LINE_DELIM).append("# Storage Information").append(LINE_DELIM); getStorageDescriptorInfo(tableInfo, table.getTTable().getSd()); if (table.isView() || table.isMaterializedView()) { tableInfo.append(LINE_DELIM).append("# View Information").append(LINE_DELIM); getViewInfo(tableInfo, table); } return tableInfo.toString(); }
private static void getViewInfo(StringBuilder tableInfo, Table tbl) { formatOutput("Original Query:", tbl.getViewOriginalText(), tableInfo); formatOutput("Expanded Query:", tbl.getViewExpandedText(), tableInfo); if (tbl.isMaterializedView()) { formatOutput("Rewrite Enabled:", tbl.isRewriteEnabled() ? "Yes" : "No", tableInfo); formatOutput("Outdated for Rewriting:", tbl.isOutdatedForRewriting() == null ? "Unknown" : tbl.isOutdatedForRewriting() ? "Yes" : "No", tableInfo); } }
@Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node instanceof TableScan) { // We can continue // TODO: Need to check that this is the same MV that we are rebuilding RelOptHiveTable hiveTable = (RelOptHiveTable) node.getTable(); if (!hiveTable.getHiveTableMD().isMaterializedView()) { // If it is not a materialized view, we do not rewrite it throw new ReturnedValue(false); } if (containsAggregate && !AcidUtils.isFullAcidTable(hiveTable.getHiveTableMD())) { // If it contains an aggregate and it is not a full acid table, // we do not rewrite it (we need MERGE support) throw new ReturnedValue(false); } } else if (node instanceof Project) { // We can continue super.visit(node, ordinal, parent); } else { throw new ReturnedValue(false); } } }.go(union.getInput(1));
if (table.isMaterializedView()) {
if (isView() || isMaterializedView()) { assert (getViewOriginalText() != null); assert (getViewExpandedText() != null);
if (!tab.isMaterializedView()) {
assert (getViewOriginalText() != null); assert (getViewExpandedText() != null); } else if (isMaterializedView()) { assert(getViewOriginalText() != null); assert(getViewExpandedText() == null);
if (ts.tableHandle.isView() || ts.tableHandle.isMaterializedView()) { throw new SemanticException(ErrorMsg.DML_AGAINST_VIEW.getMsg());
} else if (tbl.isMaterializedView()) { if (!dropTbl.getExpectMaterializedView()) { if (dropTbl.getIfExists()) { if (tbl != null) { if (tbl.isMaterializedView()) { HiveMaterializedViewsRegistry.get().dropMaterializedView(tbl);
mq.getNodeTypes(rel); for (RelNode scan : nodeTypes.get(TableScan.class)) { if (((RelOptHiveTable) scan.getTable()).getHiveTableMD().isMaterializedView()) { usesMaterializedViews = true; break;
throw new SemanticException("View definition references temporary table " + alias); if (table.isMaterializedView()) { throw new SemanticException("View definition references materialized view " + alias);
if (tbl.isMaterializedView()) { CreationMetadata cm = new CreationMetadata(MetaStoreUtils.getDefaultCatalog(conf), tbl.getDbName(),
String[] qualViewName = { dbName, table.getTableName() }; String dbDotView = BaseSemanticAnalyzer.getDotName(qualViewName); if (table.isMaterializedView()) { this.createViewDesc = new CreateViewDesc(dbDotView, table.getAllCols(),
String[] qualViewName = { dbName, table.getTableName() }; String dbDotView = BaseSemanticAnalyzer.getDotName(qualViewName); if (table.isMaterializedView()) { this.createViewDesc = new CreateViewDesc(dbDotView, table.getAllCols(),