@Override
  public int execute() throws HiveException {
    Table table = getTable();
    if (table == null) {
      return 0; // dropping not existing materialized view is handled by DropMaterializedViewAnalyzer
    }

    if (!table.isMaterializedView()) {
      if (desc.isIfExists()) {
        return 0;
      } else if (table.isView()) {
        throw new HiveException("Cannot drop a view with DROP MATERIALIZED VIEW");
      } else {
        throw new HiveException("Cannot drop a base table with DROP MATERIALIZED VIEW");
      }
    }

    // TODO: API w/catalog name
    context.getDb().dropTable(table, false);
    HiveMaterializedViewsRegistry.get().dropMaterializedView(table.getDbName(), table.getTableName());
    DDLUtils.addIfAbsentByName(new WriteEntity(table, WriteEntity.WriteType.DDL_NO_LOCK), context);

    return 0;
  }
Operation process of dropping a materialized view.
ql/src/java/org/apache/hadoop/hive/ql/ddl/view/materialized/drop/DropMaterializedViewOperation.java