hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1034655 - in /hive/trunk: ./ ql/src/java/org/apache/hadoop/hive/ql/exec/ ql/src/java/org/apache/hadoop/hive/ql/index/ ql/src/java/org/apache/hadoop/hive/ql/metadata/ ql/src/java/org/apache/hadoop/hive/ql/parse/ ql/src/java/org/apache/hadoo...
Date Sat, 13 Nov 2010 05:08:19 GMT
Author: jvs
Date: Sat Nov 13 05:08:18 2010
New Revision: 1034655

URL: http://svn.apache.org/viewvc?rev=1034655&view=rev
Log:
HIVE-1497 support COMMENT clause on CREATE INDEX, and add new
command for SHOW INDEXES
(Russell Melick via jvs)


Added:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowIndexesDesc.java
    hive/trunk/ql/src/test/queries/clientpositive/show_indexes_edge_cases.q
    hive/trunk/ql/src/test/queries/clientpositive/show_indexes_syntax.q
    hive/trunk/ql/src/test/results/clientpositive/show_indexes_edge_cases.q.out
    hive/trunk/ql/src/test/results/clientpositive/show_indexes_syntax.q.out
Modified:
    hive/trunk/CHANGES.txt
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/MetaDataFormatUtils.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java

Modified: hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hive/trunk/CHANGES.txt?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/CHANGES.txt (original)
+++ hive/trunk/CHANGES.txt Sat Nov 13 05:08:18 2010
@@ -249,6 +249,10 @@ Trunk -  Unreleased
     HIVE-1786 Better documentation for udf str_to_map
     (Siying Dong via namit)
 
+    HIVE-1497 support COMMENT clause on CREATE INDEX, and add new
+    command for SHOW INDEXES
+    (Russell Melick via jvs)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java Sat Nov 13 05:08:18 2010
@@ -37,10 +37,10 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
+import java.util.Map.Entry;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -58,6 +58,7 @@ import org.apache.hadoop.hive.metastore.
 import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
 import org.apache.hadoop.hive.metastore.api.Database;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.metastore.api.Index;
 import org.apache.hadoop.hive.metastore.api.InvalidOperationException;
 import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
@@ -82,7 +83,6 @@ import org.apache.hadoop.hive.ql.metadat
 import org.apache.hadoop.hive.ql.metadata.Table;
 import org.apache.hadoop.hive.ql.plan.AddPartitionDesc;
 import org.apache.hadoop.hive.ql.plan.AlterTableDesc;
-import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes;
 import org.apache.hadoop.hive.ql.plan.AlterTableSimpleDesc;
 import org.apache.hadoop.hive.ql.plan.CreateDatabaseDesc;
 import org.apache.hadoop.hive.ql.plan.CreateIndexDesc;
@@ -99,12 +99,14 @@ import org.apache.hadoop.hive.ql.plan.Lo
 import org.apache.hadoop.hive.ql.plan.MsckDesc;
 import org.apache.hadoop.hive.ql.plan.ShowDatabasesDesc;
 import org.apache.hadoop.hive.ql.plan.ShowFunctionsDesc;
+import org.apache.hadoop.hive.ql.plan.ShowIndexesDesc;
 import org.apache.hadoop.hive.ql.plan.ShowLocksDesc;
 import org.apache.hadoop.hive.ql.plan.ShowPartitionsDesc;
 import org.apache.hadoop.hive.ql.plan.ShowTableStatusDesc;
 import org.apache.hadoop.hive.ql.plan.ShowTablesDesc;
 import org.apache.hadoop.hive.ql.plan.SwitchDatabaseDesc;
 import org.apache.hadoop.hive.ql.plan.UnlockTableDesc;
+import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes;
 import org.apache.hadoop.hive.ql.plan.api.StageType;
 import org.apache.hadoop.hive.serde.Constants;
 import org.apache.hadoop.hive.serde2.Deserializer;
@@ -281,6 +283,11 @@ public class DDLTask extends Task<DDLWor
         return showPartitions(db, showParts);
       }
 
+      ShowIndexesDesc showIndexes = work.getShowIndexesDesc();
+      if (showIndexes != null) {
+        return showIndexes(db, showIndexes);
+      }
+
     } catch (InvalidTableException e) {
       console.printError("Table " + e.getTableName() + " does not exist");
       LOG.debug(stringifyException(e));
@@ -318,7 +325,7 @@ public class DDLTask extends Task<DDLWor
         crtIndex.getInputFormat(), crtIndex.getOutputFormat(), crtIndex.getSerde(),
         crtIndex.getStorageHandler(), crtIndex.getLocation(), crtIndex.getIdxProps(), crtIndex.getTblProps(),
         crtIndex.getSerdeProps(), crtIndex.getCollItemDelim(), crtIndex.getFieldDelim(), crtIndex.getFieldEscape(),
-        crtIndex.getLineDelim(), crtIndex.getMapKeyDelim()
+        crtIndex.getLineDelim(), crtIndex.getMapKeyDelim(), crtIndex.getIndexComment()
         );
     return 0;
   }
@@ -1084,6 +1091,60 @@ public class DDLTask extends Task<DDLWor
   }
 
   /**
+   * Write a list of indexes to a file.
+   *
+   * @param db
+   *          The database in question.
+   * @param showIndexes
+   *          These are the indexes we're interested in.
+   * @return Returns 0 when execution succeeds and above 0 if it fails.
+   * @throws HiveException
+   *           Throws this exception if an unexpected error occurs.
+   */
+  private int showIndexes(Hive db, ShowIndexesDesc showIndexes) throws HiveException {
+    // get the indexes for the table and populate the output
+    String tableName = showIndexes.getTableName();
+    Table tbl = null;
+    List<Index> indexes = null;
+
+    tbl = db.getTable(tableName);
+
+    indexes = db.getIndexes(db.getCurrentDatabase(), tbl.getTableName(), (short) -1);
+
+    // write the results in the file
+    try {
+      Path resFile = new Path(showIndexes.getResFile());
+      FileSystem fs = resFile.getFileSystem(conf);
+      DataOutput outStream = fs.create(resFile);
+
+      if (showIndexes.isFormatted()) {
+        // column headers
+        outStream.writeBytes(MetaDataFormatUtils.getIndexColumnsHeader());
+        outStream.write(terminator);
+        outStream.write(terminator);
+      }
+
+      for (Index index : indexes)
+      {
+        outStream.writeBytes(MetaDataFormatUtils.getAllColumnsInformation(index));
+      }
+
+      ((FSDataOutputStream) outStream).close();
+
+    } catch (FileNotFoundException e) {
+      LOG.info("show indexes: " + stringifyException(e));
+      throw new HiveException(e.toString());
+    } catch (IOException e) {
+      LOG.info("show indexes: " + stringifyException(e));
+      throw new HiveException(e.toString());
+    } catch (Exception e) {
+      throw new HiveException(e.toString());
+    }
+
+    return 0;
+  }
+
+  /**
    * Write a list of the available databases to a file.
    *
    * @param showDatabases

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java Sat Nov 13 05:08:18 2010
@@ -26,9 +26,9 @@ import org.apache.commons.logging.LogFac
 public class HiveIndex {
 
   public static final Log l4j = LogFactory.getLog("HiveIndex");
-  
+
   public static String INDEX_TABLE_CREATETIME = "hive.index.basetbl.dfs.lastModifiedTime";
-  
+
   public static enum IndexType {
     COMPACT_SUMMARY_TABLE("compact", "org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler");
 
@@ -37,23 +37,34 @@ public class HiveIndex {
       this.handlerClsName = className;
     }
 
-    private String indexTypeName;
-    private String handlerClsName;
+    private final String indexTypeName;
+    private final String handlerClsName;
 
     public String getName() {
       return indexTypeName;
     }
-    
+
     public String getHandlerClsName() {
       return handlerClsName;
     }
   }
-  
+
   public static IndexType getIndexType(String name) {
     IndexType[] types = IndexType.values();
     for (IndexType type : types) {
-      if(type.getName().equals(name.toLowerCase()))
+      if(type.getName().equals(name.toLowerCase())) {
+        return type;
+      }
+    }
+    return null;
+  }
+
+  public static IndexType getIndexTypeByClassName(String className) {
+    IndexType[] types = IndexType.values();
+    for (IndexType type : types) {
+      if(type.getHandlerClsName().equals(className)) {
         return type;
+      }
     }
     return null;
   }

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java Sat Nov 13 05:08:18 2010
@@ -460,7 +460,7 @@ public class Hive {
       String storageHandler, String location,
       Map<String, String> idxProps, Map<String, String> tblProps, Map<String, String> serdeProps,
       String collItemDelim, String fieldDelim, String fieldEscape,
-      String lineDelim, String mapKeyDelim)
+      String lineDelim, String mapKeyDelim, String indexComment)
       throws HiveException {
 
     try {
@@ -583,6 +583,7 @@ public class Hive {
 
       Index indexDesc = new Index(indexName, indexHandlerClass, dbName, tableName, time, time, indexTblName,
           storageDescriptor, params, deferredRebuild);
+      indexDesc.getParameters().put("comment", indexComment);
       indexHandler.analyzeIndexDefinition(baseTbl, indexDesc, tt);
 
       if (idxProps != null)
@@ -1617,4 +1618,14 @@ public class Hive {
     }
   }
 
+  public List<Index> getIndexes(String dbName, String tblName, short max) throws HiveException {
+    List<Index> indexes = null;
+    try {
+      indexes = getMSC().listIndexes(dbName, tblName, max);
+    } catch (Exception e) {
+      LOG.error(StringUtils.stringifyException(e));
+      throw new HiveException(e);
+    }
+    return indexes;
+  }
 };

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/MetaDataFormatUtils.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/MetaDataFormatUtils.java?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/MetaDataFormatUtils.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/MetaDataFormatUtils.java Sat Nov 13 05:08:18 2010
@@ -18,19 +18,23 @@
 
 package org.apache.hadoop.hive.ql.metadata;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.metastore.api.Index;
 import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
+import org.apache.hadoop.hive.ql.index.HiveIndex;
+import org.apache.hadoop.hive.ql.index.HiveIndex.IndexType;
 import org.apache.hadoop.hive.ql.plan.DescTableDesc;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Collections;
-import java.util.ArrayList;
+import org.apache.hadoop.hive.ql.plan.ShowIndexesDesc;
 
 /**
- * This class provides methods to format table information.
+ * This class provides methods to format table and index information.
  *
  */
 public final class MetaDataFormatUtils {
@@ -79,6 +83,45 @@ public final class MetaDataFormatUtils {
     }
   }
 
+
+  public static String getAllColumnsInformation(Index index) {
+    StringBuilder indexInfo = new StringBuilder(DEFAULT_STRINGBUILDER_SIZE);
+
+    List<String> indexColumns = new ArrayList<String>();
+
+    indexColumns.add(index.getIndexName());
+    indexColumns.add(index.getOrigTableName());
+
+    // index key names
+    List<FieldSchema> indexKeys = index.getSd().getCols();
+    StringBuilder keyString = new StringBuilder();
+    boolean first = true;
+    for (FieldSchema key : indexKeys)
+    {
+      if (!first)
+      {
+        keyString.append(", ");
+      }
+      keyString.append(key.getName());
+      first = false;
+    }
+
+    indexColumns.add(keyString.toString());
+
+    indexColumns.add(index.getIndexTableName());
+
+    // index type
+    String indexHandlerClass = index.getIndexHandlerClass();
+    IndexType indexType = HiveIndex.getIndexTypeByClassName(indexHandlerClass);
+    indexColumns.add(indexType.getName());
+
+    indexColumns.add(index.getParameters().get("comment"));
+
+    formatOutput(indexColumns.toArray(new String[0]), indexInfo);
+
+    return indexInfo.toString();
+}
+
   /*
     Displaying columns unformatted for backward compatibility.
    */
@@ -210,6 +253,10 @@ public final class MetaDataFormatUtils {
 
   private static void formatOutput(String[] fields, StringBuilder tableInfo) {
     for (String field : fields) {
+      if (field == null) {
+        tableInfo.append(FIELD_DELIM);
+        continue;
+      }
       tableInfo.append(String.format("%-" + ALIGNMENT + "s", field)).append(FIELD_DELIM);
     }
     tableInfo.append(LINE_DELIM);
@@ -231,4 +278,10 @@ public final class MetaDataFormatUtils {
   public static String[] getColumnsHeader() {
     return DescTableDesc.getSchema().split("#")[0].split(",");
   }
+
+  public static String getIndexColumnsHeader() {
+    StringBuilder indexCols = new StringBuilder(DEFAULT_STRINGBUILDER_SIZE);
+    formatOutput(ShowIndexesDesc.getSchema().split("#")[0].split(","), indexCols);
+    return indexCols.toString();
+  }
 }

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java Sat Nov 13 05:08:18 2010
@@ -79,6 +79,7 @@ import org.apache.hadoop.hive.ql.plan.Lo
 import org.apache.hadoop.hive.ql.plan.MsckDesc;
 import org.apache.hadoop.hive.ql.plan.ShowDatabasesDesc;
 import org.apache.hadoop.hive.ql.plan.ShowFunctionsDesc;
+import org.apache.hadoop.hive.ql.plan.ShowIndexesDesc;
 import org.apache.hadoop.hive.ql.plan.ShowLocksDesc;
 import org.apache.hadoop.hive.ql.plan.ShowPartitionsDesc;
 import org.apache.hadoop.hive.ql.plan.ShowTableStatusDesc;
@@ -232,6 +233,9 @@ public class DDLSemanticAnalyzer extends
     } else if (ast.getToken().getType() == HiveParser.TOK_SHOWPARTITIONS) {
       ctx.setResFile(new Path(ctx.getLocalTmpFileURI()));
       analyzeShowPartitions(ast);
+    } else if (ast.getToken().getType() == HiveParser.TOK_SHOWINDEXES) {
+      ctx.setResFile(new Path(ctx.getLocalTmpFileURI()));
+      analyzeShowIndexes(ast);
     } else if (ast.getToken().getType() == HiveParser.TOK_LOCKTABLE) {
       analyzeLockTable(ast);
     } else if (ast.getToken().getType() == HiveParser.TOK_UNLOCKTABLE) {
@@ -338,6 +342,7 @@ public class DDLSemanticAnalyzer extends
     String location = null;
     Map<String, String> tblProps = null;
     Map<String, String> idxProps = null;
+    String indexComment = null;
 
     RowFormatParams rowFormatParams = new RowFormatParams();
     StorageFormat storageFormat = new StorageFormat();
@@ -376,6 +381,9 @@ public class DDLSemanticAnalyzer extends
               shared.serdeProps);
         }
         break;
+      case HiveParser.TOK_INDEXCOMMENT:
+        child = (ASTNode) child.getChild(0);
+        indexComment = unescapeSQLString(child.getText());
       }
     }
 
@@ -386,7 +394,7 @@ public class DDLSemanticAnalyzer extends
         storageFormat.storageHandler, typeName, location, idxProps, tblProps,
         shared.serde, shared.serdeProps, rowFormatParams.collItemDelim,
         rowFormatParams.fieldDelim, rowFormatParams.fieldEscape,
-        rowFormatParams.lineDelim, rowFormatParams.mapKeyDelim);
+        rowFormatParams.lineDelim, rowFormatParams.mapKeyDelim, indexComment);
     Task<?> createIndex = TaskFactory.get(new DDLWork(crtIndexDesc), conf);
     rootTasks.add(createIndex);
   }
@@ -887,6 +895,21 @@ public class DDLSemanticAnalyzer extends
     setFetchTask(createFetchTask(showTblStatusDesc.getSchema()));
   }
 
+  private void analyzeShowIndexes(ASTNode ast) throws SemanticException {
+    ShowIndexesDesc showIndexesDesc;
+    String tableName = unescapeIdentifier(ast.getChild(0).getText());
+    showIndexesDesc = new ShowIndexesDesc(tableName, ctx.getResFile());
+
+    if (ast.getChildCount() == 2) {
+      int descOptions = ast.getChild(1).getType();
+      showIndexesDesc.setFormatted(descOptions == HiveParser.KW_FORMATTED);
+    }
+
+    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
+        showIndexesDesc), conf));
+    setFetchTask(createFetchTask(showIndexesDesc.getSchema()));
+  }
+
   /**
    * Add the task according to the parsed command tree. This is used for the CLI
    * command "SHOW FUNCTIONS;".

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g Sat Nov 13 05:08:18 2010
@@ -188,6 +188,8 @@ TOK_LEFTSEMIJOIN;
 TOK_LATERAL_VIEW;
 TOK_TABALIAS;
 TOK_ANALYZE;
+TOK_SHOWINDEXES;
+TOK_INDEXCOMMENT;
 }
 
 
@@ -349,16 +351,25 @@ createIndexStatement
       tableFileFormat?
       tableLocation?
       tablePropertiesPrefixed?
-    ->^(TOK_CREATEINDEX $indexName $typeName $tab $indexedCols
+      indexComment?
+    ->^(TOK_CREATEINDEX $indexName $typeName $tab $indexedCols 
         autoRebuild?
         indexPropertiesPrefixed?
         indexTblName?
         tableRowFormat?
         tableFileFormat?
         tableLocation?
-        tablePropertiesPrefixed?)
+        tablePropertiesPrefixed?
+        indexComment?)
     ;
 
+indexComment
+@init { msgs.push("comment on an index");}
+@after {msgs.pop();}
+        :
+                KW_COMMENT comment=StringLiteral  -> ^(TOK_INDEXCOMMENT $comment)
+        ;
+
 autoRebuild
 @init { msgs.push("auto rebuild index");}
 @after {msgs.pop();}
@@ -661,6 +672,8 @@ showStatement
     -> ^(TOK_SHOW_TABLESTATUS showStmtIdentifier $db_name? partitionSpec?)
     | KW_SHOW KW_LOCKS -> ^(TOK_SHOWLOCKS)
     | KW_SHOW KW_LOCKS (parttype=partTypeExpr) (isExtended=KW_EXTENDED)? -> ^(TOK_SHOWLOCKS $parttype $isExtended?)
+    | KW_SHOW (showOptions=KW_FORMATTED)? (KW_INDEX|KW_INDEXES) KW_ON showStmtIdentifier ((KW_FROM|KW_IN) db_name=Identifier)?
+    -> ^(TOK_SHOWINDEXES showStmtIdentifier $showOptions? $db_name?)  
     ;
 
 lockStatement
@@ -1762,6 +1775,7 @@ KW_PARTITIONS : 'PARTITIONS';
 KW_TABLE: 'TABLE';
 KW_TABLES: 'TABLES';
 KW_INDEX: 'INDEX';
+KW_INDEXES: 'INDEXES';
 KW_REBUILD: 'REBUILD';
 KW_FUNCTIONS: 'FUNCTIONS';
 KW_SHOW: 'SHOW';

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java Sat Nov 13 05:08:18 2010
@@ -30,7 +30,7 @@ import org.apache.hadoop.hive.ql.session
 public final class SemanticAnalyzerFactory {
 
   static HashMap<Integer, String> commandType = new HashMap<Integer, String>();
-  static HashMap<Integer, String[]> tablePartitionCommandType = new HashMap<Integer, String[]>(); 
+  static HashMap<Integer, String[]> tablePartitionCommandType = new HashMap<Integer, String[]>();
 
   static {
     commandType.put(HiveParser.TOK_EXPLAIN, "EXPLAIN");
@@ -60,6 +60,7 @@ public final class SemanticAnalyzerFacto
     commandType.put(HiveParser.TOK_SHOW_TABLESTATUS, "SHOW_TABLESTATUS");
     commandType.put(HiveParser.TOK_SHOWFUNCTIONS, "SHOWFUNCTIONS");
     commandType.put(HiveParser.TOK_SHOWPARTITIONS, "SHOWPARTITIONS");
+    commandType.put(HiveParser.TOK_SHOWINDEXES, "SHOWINDEXES");
     commandType.put(HiveParser.TOK_SHOWLOCKS, "SHOWLOCKS");
     commandType.put(HiveParser.TOK_CREATEFUNCTION, "CREATEFUNCTION");
     commandType.put(HiveParser.TOK_DROPFUNCTION, "DROPFUNCTION");
@@ -73,16 +74,16 @@ public final class SemanticAnalyzerFacto
     commandType.put(HiveParser.TOK_LOCKTABLE, "LOCKTABLE");
     commandType.put(HiveParser.TOK_UNLOCKTABLE, "UNLOCKTABLE");
   }
-  
+
   static {
-    tablePartitionCommandType.put(HiveParser.TOK_ALTERTABLE_ALTERPARTS_PROTECTMODE, 
+    tablePartitionCommandType.put(HiveParser.TOK_ALTERTABLE_ALTERPARTS_PROTECTMODE,
         new String[] { "ALTERTABLE_PROTECTMODE", "ALTERPARTITION_PROTECTMODE" });
     tablePartitionCommandType.put(HiveParser.TOK_ALTERTABLE_FILEFORMAT,
         new String[] { "ALTERTABLE_FILEFORMAT", "ALTERPARTITION_FILEFORMAT" });
     tablePartitionCommandType.put(HiveParser.TOK_ALTERTABLE_LOCATION,
         new String[] { "ALTERTABLE_LOCATION", "ALTERPARTITION_LOCATION" });
   }
-  
+
 
   public static BaseSemanticAnalyzer get(HiveConf conf, ASTNode tree)
       throws SemanticException {
@@ -120,6 +121,7 @@ public final class SemanticAnalyzerFacto
       case HiveParser.TOK_SHOW_TABLESTATUS:
       case HiveParser.TOK_SHOWFUNCTIONS:
       case HiveParser.TOK_SHOWPARTITIONS:
+      case HiveParser.TOK_SHOWINDEXES:
       case HiveParser.TOK_SHOWLOCKS:
       case HiveParser.TOK_CREATEINDEX:
       case HiveParser.TOK_DROPINDEX:

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java Sat Nov 13 05:08:18 2010
@@ -48,6 +48,7 @@ public class CreateIndexDesc extends DDL
   String lineDelim;
   String mapKeyDelim;
 
+  String indexComment;
 
   public CreateIndexDesc() {
     super();
@@ -59,7 +60,7 @@ public class CreateIndexDesc extends DDL
       String typeName, String location, Map<String, String> idxProps, Map<String, String> tblProps,
       String serde, Map<String, String> serdeProps, String collItemDelim,
       String fieldDelim, String fieldEscape, String lineDelim,
-      String mapKeyDelim) {
+      String mapKeyDelim, String indexComment) {
     super();
     this.tableName = tableName;
     this.indexName = indexName;
@@ -81,6 +82,7 @@ public class CreateIndexDesc extends DDL
     this.fieldEscape = fieldEscape;
     this.lineDelim = lineDelim;
     this.mapKeyDelim = mapKeyDelim;
+    this.indexComment = indexComment;
   }
 
   public String getTableName() {
@@ -239,4 +241,12 @@ public class CreateIndexDesc extends DDL
     this.indexTypeHandlerClass = indexTypeHandlerClass;
   }
 
-}
\ No newline at end of file
+  public String getIndexComment() {
+    return indexComment;
+  }
+
+  public void setIndexComment(String indexComment) {
+    this.indexComment = indexComment;
+  }
+
+}

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java?rev=1034655&r1=1034654&r2=1034655&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java Sat Nov 13 05:08:18 2010
@@ -53,6 +53,7 @@ public class DDLWork implements Serializ
   private AlterTableSimpleDesc alterTblSimpleDesc;
   private MsckDesc msckDesc;
   private ShowTableStatusDesc showTblStatusDesc;
+  private ShowIndexesDesc showIndexesDesc;
 
   /**
    * ReadEntitites that are passed to the hooks.
@@ -74,7 +75,7 @@ public class DDLWork implements Serializ
   public DDLWork(CreateIndexDesc createIndex) {
     this.createIndexDesc = createIndex;
   }
-  
+
   /**
    * @param createDatabaseDesc
    *          Create Database descriptor
@@ -295,6 +296,12 @@ public class DDLWork implements Serializ
     this.dropIdxDesc = dropIndexDesc;
   }
 
+  public DDLWork(HashSet<ReadEntity> inputs, HashSet<WriteEntity> outputs,
+      ShowIndexesDesc showIndexesDesc) {
+    this(inputs, outputs);
+    this.showIndexesDesc = showIndexesDesc;
+  }
+
   /**
    * @return Create Database descriptor
    */
@@ -355,7 +362,7 @@ public class DDLWork implements Serializ
   public void setCreateTblDesc(CreateTableDesc createTblDesc) {
     this.createTblDesc = createTblDesc;
   }
-  
+
   public CreateIndexDesc getCreateIndexDesc() {
     return createIndexDesc;
   }
@@ -557,6 +564,18 @@ public class DDLWork implements Serializ
   }
 
   /**
+   * @return the showIndexesDesc
+   */
+  @Explain(displayName = "Show Index Operator")
+  public ShowIndexesDesc getShowIndexesDesc() {
+    return showIndexesDesc;
+  }
+
+  public void setShowIndexesDesc(ShowIndexesDesc showIndexesDesc) {
+    this.showIndexesDesc = showIndexesDesc;
+  }
+
+  /**
    * @return the descTblDesc
    */
   @Explain(displayName = "Describe Table Operator")
@@ -659,7 +678,7 @@ public class DDLWork implements Serializ
   public void setOutputs(HashSet<WriteEntity> outputs) {
     this.outputs = outputs;
   }
-  
+
   public DropIndexDesc getDropIdxDesc() {
     return dropIdxDesc;
   }

Added: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowIndexesDesc.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowIndexesDesc.java?rev=1034655&view=auto
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowIndexesDesc.java (added)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowIndexesDesc.java Sat Nov 13 05:08:18 2010
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.plan;
+
+import java.io.Serializable;
+
+import org.apache.hadoop.fs.Path;
+
+/**
+ * ShowIndexesDesc.
+ * Returns table index information per SQL syntax.
+ */
+@Explain(displayName = "Show Indexes")
+public class ShowIndexesDesc extends DDLDesc implements Serializable {
+  private static final long serialVersionUID = 1L;
+  String tableName;
+  String resFile;
+  boolean isFormatted;
+
+  /**
+   * thrift ddl for the result of show indexes.
+   */
+  private static final String schema = "idx_name,tab_name,col_names,idx_tab_name,idx_type,comment"
+                                        + "#string:string:string:string:string:string";
+
+  public static String getSchema() {
+    return schema;
+  }
+
+  public String getTableName() {
+    return tableName;
+  }
+
+  public String getResFile() {
+    return resFile;
+  }
+
+  public boolean isFormatted() {
+    return isFormatted;
+  }
+
+  public void setFormatted(boolean isFormatted) {
+    this.isFormatted = isFormatted;
+  }
+
+  /**
+   *
+   * @param tableName
+   *          Name of the table whose indexes need to be listed.
+   * @param resFile
+   *          File to store the results in.
+   */
+  public ShowIndexesDesc(String tableName, Path resFile) {
+    this.tableName = tableName;
+    this.resFile = resFile.toString();
+  }
+}

Added: hive/trunk/ql/src/test/queries/clientpositive/show_indexes_edge_cases.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/show_indexes_edge_cases.q?rev=1034655&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/show_indexes_edge_cases.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/show_indexes_edge_cases.q Sat Nov 13 05:08:18 2010
@@ -0,0 +1,25 @@
+DROP TABLE show_idx_empty;
+DROP TABLE show_idx_full;
+
+CREATE TABLE show_idx_empty(KEY STRING, VALUE STRING);
+CREATE TABLE show_idx_full(KEY STRING, VALUE1 STRING, VALUE2 STRING);
+
+CREATE INDEX idx_1 ON TABLE show_idx_full(KEY) AS "COMPACT" WITH DEFERRED REBUILD;
+CREATE INDEX idx_2 ON TABLE show_idx_full(VALUE1) AS "COMPACT" WITH DEFERRED REBUILD;
+
+CREATE INDEX idx_comment ON TABLE show_idx_full(VALUE2) AS "COMPACT" WITH DEFERRED REBUILD COMMENT "index comment";
+CREATE INDEX idx_compound ON TABLE show_idx_full(KEY, VALUE1) AS "COMPACT" WITH DEFERRED REBUILD;
+
+ALTER INDEX idx_1 ON show_idx_full REBUILD;
+ALTER INDEX idx_2 ON show_idx_full REBUILD;
+ALTER INDEX idx_comment ON show_idx_full REBUILD;
+ALTER INDEX idx_compound ON show_idx_full REBUILD;
+
+EXPLAIN SHOW INDEXES ON show_idx_full;
+SHOW INDEXES ON show_idx_full;
+
+EXPLAIN SHOW INDEXES ON show_idx_empty;
+SHOW INDEXES ON show_idx_empty;
+
+DROP TABLE show_idx_empty;
+DROP TABLE show_idx_full;
\ No newline at end of file

Added: hive/trunk/ql/src/test/queries/clientpositive/show_indexes_syntax.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/show_indexes_syntax.q?rev=1034655&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/show_indexes_syntax.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/show_indexes_syntax.q Sat Nov 13 05:08:18 2010
@@ -0,0 +1,23 @@
+DROP TABLE show_idx_t1;
+
+CREATE TABLE show_idx_t1(KEY STRING, VALUE STRING);
+
+CREATE INDEX idx_t1 ON TABLE show_idx_t1(KEY) AS "COMPACT" WITH DEFERRED REBUILD;
+ALTER INDEX idx_t1 ON show_idx_t1 REBUILD;
+
+EXPLAIN
+SHOW INDEX ON show_idx_t1;
+
+SHOW INDEX ON show_idx_t1;
+
+EXPLAIN
+SHOW INDEXES ON show_idx_t1;
+
+SHOW INDEXES ON show_idx_t1;
+
+EXPLAIN
+SHOW FORMATTED INDEXES ON show_idx_t1;
+
+SHOW FORMATTED INDEXES ON show_idx_t1;
+
+DROP TABLE show_idx_t1;

Added: hive/trunk/ql/src/test/results/clientpositive/show_indexes_edge_cases.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/show_indexes_edge_cases.q.out?rev=1034655&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/show_indexes_edge_cases.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/show_indexes_edge_cases.q.out Sat Nov 13 05:08:18 2010
@@ -0,0 +1,245 @@
+PREHOOK: query: DROP TABLE show_idx_empty
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE show_idx_empty
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: DROP TABLE show_idx_full
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE show_idx_full
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: CREATE TABLE show_idx_empty(KEY STRING, VALUE STRING)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE show_idx_empty(KEY STRING, VALUE STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@show_idx_empty
+PREHOOK: query: CREATE TABLE show_idx_full(KEY STRING, VALUE1 STRING, VALUE2 STRING)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE show_idx_full(KEY STRING, VALUE1 STRING, VALUE2 STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@show_idx_full
+PREHOOK: query: CREATE INDEX idx_1 ON TABLE show_idx_full(KEY) AS "COMPACT" WITH DEFERRED REBUILD
+PREHOOK: type: CREATEINDEX
+POSTHOOK: query: CREATE INDEX idx_1 ON TABLE show_idx_full(KEY) AS "COMPACT" WITH DEFERRED REBUILD
+POSTHOOK: type: CREATEINDEX
+PREHOOK: query: CREATE INDEX idx_2 ON TABLE show_idx_full(VALUE1) AS "COMPACT" WITH DEFERRED REBUILD
+PREHOOK: type: CREATEINDEX
+POSTHOOK: query: CREATE INDEX idx_2 ON TABLE show_idx_full(VALUE1) AS "COMPACT" WITH DEFERRED REBUILD
+POSTHOOK: type: CREATEINDEX
+PREHOOK: query: CREATE INDEX idx_comment ON TABLE show_idx_full(VALUE2) AS "COMPACT" WITH DEFERRED REBUILD COMMENT "index comment"
+PREHOOK: type: CREATEINDEX
+POSTHOOK: query: CREATE INDEX idx_comment ON TABLE show_idx_full(VALUE2) AS "COMPACT" WITH DEFERRED REBUILD COMMENT "index comment"
+POSTHOOK: type: CREATEINDEX
+PREHOOK: query: CREATE INDEX idx_compound ON TABLE show_idx_full(KEY, VALUE1) AS "COMPACT" WITH DEFERRED REBUILD
+PREHOOK: type: CREATEINDEX
+POSTHOOK: query: CREATE INDEX idx_compound ON TABLE show_idx_full(KEY, VALUE1) AS "COMPACT" WITH DEFERRED REBUILD
+POSTHOOK: type: CREATEINDEX
+PREHOOK: query: ALTER INDEX idx_1 ON show_idx_full REBUILD
+PREHOOK: type: QUERY
+PREHOOK: Input: default@show_idx_full
+PREHOOK: Output: default@default__show_idx_full_idx_1__
+POSTHOOK: query: ALTER INDEX idx_1 ON show_idx_full REBUILD
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@show_idx_full
+POSTHOOK: Output: default@default__show_idx_full_idx_1__
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+PREHOOK: query: ALTER INDEX idx_2 ON show_idx_full REBUILD
+PREHOOK: type: QUERY
+PREHOOK: Input: default@show_idx_full
+PREHOOK: Output: default@default__show_idx_full_idx_2__
+POSTHOOK: query: ALTER INDEX idx_2 ON show_idx_full REBUILD
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@show_idx_full
+POSTHOOK: Output: default@default__show_idx_full_idx_2__
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+PREHOOK: query: ALTER INDEX idx_comment ON show_idx_full REBUILD
+PREHOOK: type: QUERY
+PREHOOK: Input: default@show_idx_full
+PREHOOK: Output: default@default__show_idx_full_idx_comment__
+POSTHOOK: query: ALTER INDEX idx_comment ON show_idx_full REBUILD
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@show_idx_full
+POSTHOOK: Output: default@default__show_idx_full_idx_comment__
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__.value2 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value2, type:string, comment:null), ]
+PREHOOK: query: ALTER INDEX idx_compound ON show_idx_full REBUILD
+PREHOOK: type: QUERY
+PREHOOK: Input: default@show_idx_full
+PREHOOK: Output: default@default__show_idx_full_idx_compound__
+POSTHOOK: query: ALTER INDEX idx_compound ON show_idx_full REBUILD
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@show_idx_full
+POSTHOOK: Output: default@default__show_idx_full_idx_compound__
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__.value2 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value2, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+PREHOOK: query: EXPLAIN SHOW INDEXES ON show_idx_full
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: EXPLAIN SHOW INDEXES ON show_idx_full
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__.value2 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value2, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_SHOWINDEXES show_idx_full)
+
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+  Stage-1 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+      Show Index Operator:
+        Show Indexes
+
+  Stage: Stage-1
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: SHOW INDEXES ON show_idx_full
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: SHOW INDEXES ON show_idx_full
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__.value2 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value2, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+idx_1               	show_idx_full       	key                 	default__show_idx_full_idx_1__	compact             	
+idx_2               	show_idx_full       	value1              	default__show_idx_full_idx_2__	compact             	
+idx_comment         	show_idx_full       	value2              	default__show_idx_full_idx_comment__	compact             	index comment       
+idx_compound        	show_idx_full       	key, value1         	default__show_idx_full_idx_compound__	compact             	
+PREHOOK: query: EXPLAIN SHOW INDEXES ON show_idx_empty
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: EXPLAIN SHOW INDEXES ON show_idx_empty
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__.value2 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value2, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_SHOWINDEXES show_idx_empty)
+
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+  Stage-1 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+      Show Index Operator:
+        Show Indexes
+
+  Stage: Stage-1
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: SHOW INDEXES ON show_idx_empty
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: SHOW INDEXES ON show_idx_empty
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__.value2 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value2, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+PREHOOK: query: DROP TABLE show_idx_empty
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@show_idx_empty
+PREHOOK: Output: default@show_idx_empty
+POSTHOOK: query: DROP TABLE show_idx_empty
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@show_idx_empty
+POSTHOOK: Output: default@show_idx_empty
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__.value2 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value2, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+PREHOOK: query: DROP TABLE show_idx_full
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@show_idx_full
+PREHOOK: Output: default@show_idx_full
+POSTHOOK: query: DROP TABLE show_idx_full
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@show_idx_full
+POSTHOOK: Output: default@show_idx_full
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_1__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_2__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_comment__.value2 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value2, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._bucketname SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__._offsets EXPRESSION [(show_idx_full)show_idx_full.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.key SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: default__show_idx_full_idx_compound__.value1 SIMPLE [(show_idx_full)show_idx_full.FieldSchema(name:value1, type:string, comment:null), ]

Added: hive/trunk/ql/src/test/results/clientpositive/show_indexes_syntax.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/show_indexes_syntax.q.out?rev=1034655&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/show_indexes_syntax.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/show_indexes_syntax.q.out Sat Nov 13 05:08:18 2010
@@ -0,0 +1,140 @@
+PREHOOK: query: DROP TABLE show_idx_t1
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE show_idx_t1
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: CREATE TABLE show_idx_t1(KEY STRING, VALUE STRING)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE show_idx_t1(KEY STRING, VALUE STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@show_idx_t1
+PREHOOK: query: CREATE INDEX idx_t1 ON TABLE show_idx_t1(KEY) AS "COMPACT" WITH DEFERRED REBUILD
+PREHOOK: type: CREATEINDEX
+POSTHOOK: query: CREATE INDEX idx_t1 ON TABLE show_idx_t1(KEY) AS "COMPACT" WITH DEFERRED REBUILD
+POSTHOOK: type: CREATEINDEX
+PREHOOK: query: ALTER INDEX idx_t1 ON show_idx_t1 REBUILD
+PREHOOK: type: QUERY
+PREHOOK: Input: default@show_idx_t1
+PREHOOK: Output: default@default__show_idx_t1_idx_t1__
+POSTHOOK: query: ALTER INDEX idx_t1 ON show_idx_t1 REBUILD
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@show_idx_t1
+POSTHOOK: Output: default@default__show_idx_t1_idx_t1__
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._bucketname SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._offsets EXPRESSION [(show_idx_t1)show_idx_t1.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__.key SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:key, type:string, comment:null), ]
+PREHOOK: query: EXPLAIN
+SHOW INDEX ON show_idx_t1
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: EXPLAIN
+SHOW INDEX ON show_idx_t1
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._bucketname SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._offsets EXPRESSION [(show_idx_t1)show_idx_t1.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__.key SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:key, type:string, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_SHOWINDEXES show_idx_t1)
+
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+  Stage-1 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+      Show Index Operator:
+        Show Indexes
+
+  Stage: Stage-1
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: SHOW INDEX ON show_idx_t1
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: SHOW INDEX ON show_idx_t1
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._bucketname SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._offsets EXPRESSION [(show_idx_t1)show_idx_t1.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__.key SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:key, type:string, comment:null), ]
+idx_t1              	show_idx_t1         	key                 	default__show_idx_t1_idx_t1__	compact             	
+PREHOOK: query: EXPLAIN
+SHOW INDEXES ON show_idx_t1
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: EXPLAIN
+SHOW INDEXES ON show_idx_t1
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._bucketname SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._offsets EXPRESSION [(show_idx_t1)show_idx_t1.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__.key SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:key, type:string, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_SHOWINDEXES show_idx_t1)
+
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+  Stage-1 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+      Show Index Operator:
+        Show Indexes
+
+  Stage: Stage-1
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: SHOW INDEXES ON show_idx_t1
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: SHOW INDEXES ON show_idx_t1
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._bucketname SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._offsets EXPRESSION [(show_idx_t1)show_idx_t1.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__.key SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:key, type:string, comment:null), ]
+idx_t1              	show_idx_t1         	key                 	default__show_idx_t1_idx_t1__	compact             	
+PREHOOK: query: EXPLAIN
+SHOW FORMATTED INDEXES ON show_idx_t1
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: EXPLAIN
+SHOW FORMATTED INDEXES ON show_idx_t1
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._bucketname SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._offsets EXPRESSION [(show_idx_t1)show_idx_t1.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__.key SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:key, type:string, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_SHOWINDEXES show_idx_t1 FORMATTED)
+
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+  Stage-1 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+      Show Index Operator:
+        Show Indexes
+
+  Stage: Stage-1
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: SHOW FORMATTED INDEXES ON show_idx_t1
+PREHOOK: type: SHOWINDEXES
+POSTHOOK: query: SHOW FORMATTED INDEXES ON show_idx_t1
+POSTHOOK: type: SHOWINDEXES
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._bucketname SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._offsets EXPRESSION [(show_idx_t1)show_idx_t1.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__.key SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:key, type:string, comment:null), ]
+idx_name            	tab_name            	col_names           	idx_tab_name        	idx_type            	comment             
+	 	 	 	 	 
+	 	 	 	 	 
+idx_t1              	show_idx_t1         	key                 	default__show_idx_t1_idx_t1__	compact             	
+PREHOOK: query: DROP TABLE show_idx_t1
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@show_idx_t1
+PREHOOK: Output: default@show_idx_t1
+POSTHOOK: query: DROP TABLE show_idx_t1
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@show_idx_t1
+POSTHOOK: Output: default@show_idx_t1
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._bucketname SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__._offsets EXPRESSION [(show_idx_t1)show_idx_t1.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ]
+POSTHOOK: Lineage: default__show_idx_t1_idx_t1__.key SIMPLE [(show_idx_t1)show_idx_t1.FieldSchema(name:key, type:string, comment:null), ]



Mime
View raw message