hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heyongqi...@apache.org
Subject svn commit: r1030122 - in /hive/trunk: ./ ql/src/java/org/apache/hadoop/hive/ql/exec/ ql/src/java/org/apache/hadoop/hive/ql/parse/ ql/src/java/org/apache/hadoop/hive/ql/plan/ ql/src/test/queries/clientpositive/ ql/src/test/results/clientpositive/
Date Tue, 02 Nov 2010 17:02:05 GMT
Author: heyongqiang
Date: Tue Nov  2 17:02:05 2010
New Revision: 1030122

URL: http://svn.apache.org/viewvc?rev=1030122&view=rev
Log:
HIVE-1761. Support show locks for a particular table.(namit via He Yongqiang)

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/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/plan/ShowLocksDesc.java
    hive/trunk/ql/src/test/queries/clientpositive/lock1.q
    hive/trunk/ql/src/test/queries/clientpositive/lock2.q
    hive/trunk/ql/src/test/results/clientpositive/lock1.q.out
    hive/trunk/ql/src/test/results/clientpositive/lock2.q.out

Modified: hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hive/trunk/CHANGES.txt?rev=1030122&r1=1030121&r2=1030122&view=diff
==============================================================================
--- hive/trunk/CHANGES.txt (original)
+++ hive/trunk/CHANGES.txt Tue Nov  2 17:02:05 2010
@@ -214,6 +214,9 @@ Trunk -  Unreleased
     HIVE-1498. support IDXPROPERTIES on CREATE INDEX
     (Marquis Wang via jvs)
 
+    HIVE-1761. Support show locks for a particular table
+    (namit via He Yongqiang)
+
   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=1030122&r1=1030121&r2=1030122&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 Tue Nov  2 17:02:05
2010
@@ -1242,7 +1242,15 @@ public class DDLTask extends Task<DDLWor
       Path resFile = new Path(showLocks.getResFile());
       FileSystem fs = resFile.getFileSystem(conf);
       DataOutput outStream = fs.create(resFile);
-      List<HiveLock> locks = lockMgr.getLocks();
+      List<HiveLock> locks = null;
+
+      if (showLocks.getTableName() == null) {
+        locks = lockMgr.getLocks();
+      }
+      else {
+        locks = lockMgr.getLocks(getHiveObject(showLocks.getTableName(),
+                                               showLocks.getPartSpec()));
+      }
 
       Collections.sort(locks, new Comparator<HiveLock>() {
 
@@ -1329,29 +1337,13 @@ public class DDLTask extends Task<DDLWor
     return 0;
   }
 
-  /**
-   * Unlock the table/partition specified
-   *
-   * @param unlockTbl
-   *          the table/partition to be unlocked
-   * @return Returns 0 when execution succeeds and above 0 if it fails.
-   * @throws HiveException
-   *           Throws this exception if an unexpected error occurs.
-   */
-  private int unlockTable(UnlockTableDesc unlockTbl) throws HiveException {
-    Context ctx = driverContext.getCtx();
-    HiveLockManager lockMgr = ctx.getHiveLockMgr();
-    if (lockMgr == null) {
-      throw new HiveException("unlock Table LockManager not specified");
-    }
-
-    String tabName = unlockTbl.getTableName();
+  private HiveLockObject getHiveObject(String tabName,
+                                       Map<String, String> partSpec) throws HiveException
{
     Table  tbl = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tabName);
     if (tbl == null) {
       throw new HiveException("Table " + tabName + " does not exist ");
     }
 
-    Map<String, String> partSpec = unlockTbl.getPartSpec();
     HiveLockObject obj = null;
 
     if  (partSpec == null) {
@@ -1364,6 +1356,27 @@ public class DDLTask extends Task<DDLWor
       }
       obj = new HiveLockObject(par);
     }
+    return obj;
+  }
+
+  /**
+   * Unlock the table/partition specified
+   *
+   * @param unlockTbl
+   *          the table/partition to be unlocked
+   * @return Returns 0 when execution succeeds and above 0 if it fails.
+   * @throws HiveException
+   *           Throws this exception if an unexpected error occurs.
+   */
+  private int unlockTable(UnlockTableDesc unlockTbl) throws HiveException {
+    Context ctx = driverContext.getCtx();
+    HiveLockManager lockMgr = ctx.getHiveLockMgr();
+    if (lockMgr == null) {
+      throw new HiveException("unlock Table LockManager not specified");
+    }
+
+    String tabName = unlockTbl.getTableName();
+    HiveLockObject obj = getHiveObject(tabName, unlockTbl.getPartSpec());
 
     List<HiveLock> locks = lockMgr.getLocks(obj);
     if ((locks == null) || (locks.isEmpty())) {

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=1030122&r1=1030121&r2=1030122&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 Tue Nov
 2 17:02:05 2010
@@ -919,7 +919,23 @@ public class DDLSemanticAnalyzer extends
    *           Parsing failed
    */
   private void analyzeShowLocks(ASTNode ast) throws SemanticException {
-    ShowLocksDesc showLocksDesc = new ShowLocksDesc(ctx.getResFile());
+    String tableName = null;
+    HashMap<String, String> partSpec = null;
+
+    if (ast.getChildCount() == 1) {
+      // table for which show locks is being executed
+      ASTNode tableTypeExpr = (ASTNode) ast.getChild(0);
+      tableName = getFullyQualifiedName((ASTNode)tableTypeExpr.getChild(0));
+
+      // get partition metadata if partition specified
+      if (tableTypeExpr.getChildCount() == 2) {
+        ASTNode partspec = (ASTNode) tableTypeExpr.getChild(1);
+        partSpec = getPartSpec(partspec);
+      }
+    }
+
+    ShowLocksDesc showLocksDesc = new ShowLocksDesc(ctx.getResFile(), tableName,
+                                                    partSpec);
     rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
         showLocksDesc), conf));
     setFetchTask(createFetchTask(showLocksDesc.getSchema()));

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=1030122&r1=1030121&r2=1030122&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 Tue Nov  2 17:02:05 2010
@@ -339,8 +339,8 @@ createTableStatement
 createIndexStatement
 @init { msgs.push("create index statement");}
 @after {msgs.pop();}
-    : KW_CREATE KW_INDEX indexName=Identifier 
-      KW_ON KW_TABLE tab=Identifier LPAREN indexedCols=columnNameList RPAREN 
+    : KW_CREATE KW_INDEX indexName=Identifier
+      KW_ON KW_TABLE tab=Identifier LPAREN indexedCols=columnNameList RPAREN
       KW_AS typeName=StringLiteral
       autoRebuild?
       indexPropertiesPrefixed?
@@ -349,7 +349,7 @@ createIndexStatement
       tableFileFormat?
       tableLocation?
       tablePropertiesPrefixed?
-    ->^(TOK_CREATEINDEX $indexName $typeName $tab $indexedCols 
+    ->^(TOK_CREATEINDEX $indexName $typeName $tab $indexedCols
         autoRebuild?
         indexPropertiesPrefixed?
         indexTblName?
@@ -475,7 +475,7 @@ alterStatementSuffixAddPartitions
     : Identifier KW_ADD ifNotExists? partitionSpec partitionLocation? (partitionSpec partitionLocation?)*
     -> ^(TOK_ALTERTABLE_ADDPARTS Identifier ifNotExists? (partitionSpec partitionLocation?)+)
     ;
-    
+
 alterStatementSuffixTouch
 @init { msgs.push("touch statement"); }
 @after { msgs.pop(); }
@@ -537,7 +537,7 @@ alterStatementSuffixSerdeProperties
 tablePartitionPrefix
 @init {msgs.push("table partition prefix");}
 @after {msgs.pop();}
-  :name=Identifier partitionSpec? 
+  :name=Identifier partitionSpec?
   ->^(TOK_TABLE_PARTITION $name partitionSpec?)
   ;
 
@@ -598,7 +598,7 @@ alterStatementSuffixClusterbySortby
 @after{msgs.pop();}
 	:name=Identifier tableBuckets
 	->^(TOK_ALTERTABLE_CLUSTER_SORT $name tableBuckets)
-	| 
+	|
 	name=Identifier KW_NOT KW_CLUSTERED
 	->^(TOK_ALTERTABLE_CLUSTER_SORT $name)
 	;
@@ -606,8 +606,8 @@ alterStatementSuffixClusterbySortby
 alterIndexRebuild
 @init { msgs.push("update index statement");}
 @after {msgs.pop();}
-    : KW_ALTER KW_INDEX indexName=Identifier 
-      KW_ON base_table_name=Identifier 
+    : KW_ALTER KW_INDEX indexName=Identifier
+      KW_ON base_table_name=Identifier
       partitionSpec?
       KW_REBUILD
     ->^(TOK_ALTERINDEX_REBUILD $base_table_name $indexName partitionSpec?)
@@ -621,7 +621,7 @@ fileFormat
     | KW_RCFILE  -> ^(TOK_TBLRCFILE)
     | KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral (KW_INPUTDRIVER
inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)?
       -> ^(TOK_TABLEFILEFORMAT $inFmt $outFmt $inDriver? $outDriver?)
-    | genericSpec=Identifier -> ^(TOK_FILEFORMAT_GENERIC $genericSpec) 
+    | genericSpec=Identifier -> ^(TOK_FILEFORMAT_GENERIC $genericSpec)
     ;
 
 tabTypeExpr
@@ -643,7 +643,7 @@ descStatement
     : (KW_DESCRIBE|KW_DESC) (descOptions=KW_FORMATTED|descOptions=KW_EXTENDED)? (parttype=partTypeExpr)
-> ^(TOK_DESCTABLE $parttype $descOptions?)
     | (KW_DESCRIBE|KW_DESC) KW_FUNCTION KW_EXTENDED? (name=descFuncNames) -> ^(TOK_DESCFUNCTION
$name KW_EXTENDED?)
     ;
-    
+
 analyzeStatement
 @init { msgs.push("analyze statement"); }
 @after { msgs.pop(); }
@@ -660,6 +660,7 @@ showStatement
     | KW_SHOW KW_TABLE KW_EXTENDED ((KW_FROM|KW_IN) db_name=Identifier)? KW_LIKE showStmtIdentifier
partitionSpec?
     -> ^(TOK_SHOW_TABLESTATUS showStmtIdentifier $db_name? partitionSpec?)
     | KW_SHOW KW_LOCKS -> ^(TOK_SHOWLOCKS)
+    | KW_SHOW KW_LOCKS (parttype=partTypeExpr) -> ^(TOK_SHOWLOCKS $parttype)
     ;
 
 lockStatement
@@ -869,12 +870,12 @@ tableFileFormat
       KW_STORED KW_AS KW_SEQUENCEFILE  -> TOK_TBLSEQUENCEFILE
       | KW_STORED KW_AS KW_TEXTFILE  -> TOK_TBLTEXTFILE
       | KW_STORED KW_AS KW_RCFILE  -> TOK_TBLRCFILE
-      | KW_STORED KW_AS KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral
(KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)?      
+      | KW_STORED KW_AS KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral
(KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)?
       -> ^(TOK_TABLEFILEFORMAT $inFmt $outFmt $inDriver? $outDriver?)
       | KW_STORED KW_BY storageHandler=StringLiteral
          (KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)?
       -> ^(TOK_STORAGEHANDLER $storageHandler $serdeprops?)
-      | KW_STORED KW_AS genericSpec=Identifier      
+      | KW_STORED KW_AS genericSpec=Identifier
       -> ^(TOK_FILEFORMAT_GENERIC $genericSpec)
     ;
 
@@ -977,7 +978,7 @@ type
     : primitiveType
     | listType
     | structType
-    | mapType 
+    | mapType
     | unionType;
 
 primitiveType
@@ -1852,7 +1853,7 @@ KW_TEMPORARY: 'TEMPORARY';
 KW_FUNCTION: 'FUNCTION';
 KW_EXPLAIN: 'EXPLAIN';
 KW_EXTENDED: 'EXTENDED';
-KW_FORMATTED: 'FORMATTED';	 
+KW_FORMATTED: 'FORMATTED';
 KW_SERDE: 'SERDE';
 KW_WITH: 'WITH';
 KW_DEFERRED: 'DEFERRED';

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowLocksDesc.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowLocksDesc.java?rev=1030122&r1=1030121&r2=1030122&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowLocksDesc.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowLocksDesc.java Tue Nov  2 17:02:05
2010
@@ -19,6 +19,7 @@
 package org.apache.hadoop.hive.ql.plan;
 
 import java.io.Serializable;
+import java.util.HashMap;
 
 import org.apache.hadoop.fs.Path;
 
@@ -30,6 +31,8 @@ import org.apache.hadoop.fs.Path;
 public class ShowLocksDesc extends DDLDesc implements Serializable {
   private static final long serialVersionUID = 1L;
   String resFile;
+  String tableName;
+  HashMap<String, String> partSpec;
 
   /**
    * table name for the result of show locks.
@@ -54,8 +57,43 @@ public class ShowLocksDesc extends DDLDe
   /**
    * @param resFile
    */
-  public ShowLocksDesc(Path resFile) {
+  public ShowLocksDesc(Path resFile, String tableName,
+     HashMap<String, String> partSpec) {
     this.resFile = resFile.toString();
+    this.partSpec = partSpec;
+    this.tableName = tableName;
+  }
+
+  /**
+   * @return the tableName
+   */
+  @Explain(displayName = "table")
+  public String getTableName() {
+    return tableName;
+  }
+
+  /**
+   * @param tableName
+   *          the tableName to set
+   */
+  public void setTableName(String tableName) {
+    this.tableName = tableName;
+  }
+
+  /**
+   * @return the partSpec
+   */
+  @Explain(displayName = "partition")
+  public HashMap<String, String> getPartSpec() {
+    return partSpec;
+  }
+
+  /**
+   * @param partSpec
+   *          the partSpec to set
+   */
+  public void setPartSpecs(HashMap<String, String> partSpec) {
+    this.partSpec = partSpec;
   }
 
   /**

Modified: hive/trunk/ql/src/test/queries/clientpositive/lock1.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/lock1.q?rev=1030122&r1=1030121&r2=1030122&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/lock1.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/lock1.q Tue Nov  2 17:02:05 2010
@@ -3,16 +3,21 @@ create table tstsrc like src;
 insert overwrite table tstsrc select key, value from src;
 
 SHOW LOCKS;
+SHOW LOCKS tstsrc;
 
 LOCK TABLE tstsrc shared;
 SHOW LOCKS;
+SHOW LOCKS tstsrc;
 UNLOCK TABLE tstsrc;
 SHOW LOCKS;
+SHOW LOCKS tstsrc;
 lock TABLE tstsrc SHARED;
 SHOW LOCKS;
+SHOW LOCKS tstsrc;
 LOCK TABLE tstsrc SHARED;
 SHOW LOCKS;
+SHOW LOCKS tstsrc;
 UNLOCK TABLE tstsrc;
 SHOW LOCKS;
-
+SHOW LOCKS tstsrc;
 drop table tstsrc;

Modified: hive/trunk/ql/src/test/queries/clientpositive/lock2.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/lock2.q?rev=1030122&r1=1030121&r2=1030122&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/lock2.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/lock2.q Tue Nov  2 17:02:05 2010
@@ -12,12 +12,23 @@ LOCK TABLE tstsrc SHARED;
 LOCK TABLE tstsrcpart SHARED;
 LOCK TABLE tstsrcpart PARTITION(ds='2008-04-08', hr='11') EXCLUSIVE;
 SHOW LOCKS;
+SHOW LOCKS tstsrcpart;
+SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11');
+
 UNLOCK TABLE tstsrc;
 SHOW LOCKS;
+SHOW LOCKS tstsrcpart;
+SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11');
+
 UNLOCK TABLE tstsrcpart;
 SHOW LOCKS;
+SHOW LOCKS tstsrcpart;
+SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11');
+
 UNLOCK TABLE tstsrcpart PARTITION(ds='2008-04-08', hr='11');
 SHOW LOCKS;
+SHOW LOCKS tstsrcpart;
+SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11');
 
 
 drop table tstsrc;

Modified: hive/trunk/ql/src/test/results/clientpositive/lock1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/lock1.q.out?rev=1030122&r1=1030121&r2=1030122&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/lock1.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/lock1.q.out Tue Nov  2 17:02:05 2010
@@ -23,6 +23,12 @@ POSTHOOK: query: SHOW LOCKS
 POSTHOOK: type: SHOWLOCKS
 POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
 POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: SHOW LOCKS tstsrc
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrc
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
 PREHOOK: query: LOCK TABLE tstsrc shared
 PREHOOK: type: LOCKTABLE
 POSTHOOK: query: LOCK TABLE tstsrc shared
@@ -36,6 +42,13 @@ POSTHOOK: type: SHOWLOCKS
 POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
 POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
 default@tstsrc	SHARED
+PREHOOK: query: SHOW LOCKS tstsrc
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrc
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+default@tstsrc	SHARED
 PREHOOK: query: UNLOCK TABLE tstsrc
 PREHOOK: type: UNLOCKTABLE
 POSTHOOK: query: UNLOCK TABLE tstsrc
@@ -48,6 +61,12 @@ POSTHOOK: query: SHOW LOCKS
 POSTHOOK: type: SHOWLOCKS
 POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
 POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: SHOW LOCKS tstsrc
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrc
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
 PREHOOK: query: lock TABLE tstsrc SHARED
 PREHOOK: type: LOCKTABLE
 POSTHOOK: query: lock TABLE tstsrc SHARED
@@ -61,6 +80,13 @@ POSTHOOK: type: SHOWLOCKS
 POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
 POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
 default@tstsrc	SHARED
+PREHOOK: query: SHOW LOCKS tstsrc
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrc
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+default@tstsrc	SHARED
 PREHOOK: query: LOCK TABLE tstsrc SHARED
 PREHOOK: type: LOCKTABLE
 POSTHOOK: query: LOCK TABLE tstsrc SHARED
@@ -75,6 +101,14 @@ POSTHOOK: Lineage: tstsrc.key SIMPLE [(s
 POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
 default@tstsrc	SHARED
 default@tstsrc	SHARED
+PREHOOK: query: SHOW LOCKS tstsrc
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrc
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+default@tstsrc	SHARED
+default@tstsrc	SHARED
 PREHOOK: query: UNLOCK TABLE tstsrc
 PREHOOK: type: UNLOCKTABLE
 POSTHOOK: query: UNLOCK TABLE tstsrc
@@ -87,6 +121,12 @@ POSTHOOK: query: SHOW LOCKS
 POSTHOOK: type: SHOWLOCKS
 POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
 POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: SHOW LOCKS tstsrc
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrc
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
 PREHOOK: query: drop table tstsrc
 PREHOOK: type: DROPTABLE
 PREHOOK: Input: default@tstsrc

Modified: hive/trunk/ql/src/test/results/clientpositive/lock2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/lock2.q.out?rev=1030122&r1=1030121&r2=1030122&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/lock2.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/lock2.q.out Tue Nov  2 17:02:05 2010
@@ -79,6 +79,24 @@ POSTHOOK: Lineage: tstsrcpart PARTITION(
 default@tstsrc	SHARED
 default@tstsrcpart	SHARED
 default@tstsrcpart@ds=2008-04-08/hr=11	EXCLUSIVE
+PREHOOK: query: SHOW LOCKS tstsrcpart
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrcpart
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
+default@tstsrcpart	SHARED
+PREHOOK: query: SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11')
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11')
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
+default@tstsrcpart@ds=2008-04-08/hr=11	EXCLUSIVE
 PREHOOK: query: UNLOCK TABLE tstsrc
 PREHOOK: type: UNLOCKTABLE
 POSTHOOK: query: UNLOCK TABLE tstsrc
@@ -97,6 +115,24 @@ POSTHOOK: Lineage: tstsrcpart PARTITION(
 POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
 default@tstsrcpart	SHARED
 default@tstsrcpart@ds=2008-04-08/hr=11	EXCLUSIVE
+PREHOOK: query: SHOW LOCKS tstsrcpart
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrcpart
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
+default@tstsrcpart	SHARED
+PREHOOK: query: SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11')
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11')
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
+default@tstsrcpart@ds=2008-04-08/hr=11	EXCLUSIVE
 PREHOOK: query: UNLOCK TABLE tstsrcpart
 PREHOOK: type: UNLOCKTABLE
 POSTHOOK: query: UNLOCK TABLE tstsrcpart
@@ -114,6 +150,23 @@ POSTHOOK: Lineage: tstsrc.value SIMPLE [
 POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
 POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
 default@tstsrcpart@ds=2008-04-08/hr=11	EXCLUSIVE
+PREHOOK: query: SHOW LOCKS tstsrcpart
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrcpart
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
+PREHOOK: query: SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11')
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11')
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
+default@tstsrcpart@ds=2008-04-08/hr=11	EXCLUSIVE
 PREHOOK: query: UNLOCK TABLE tstsrcpart PARTITION(ds='2008-04-08', hr='11')
 PREHOOK: type: UNLOCKTABLE
 POSTHOOK: query: UNLOCK TABLE tstsrcpart PARTITION(ds='2008-04-08', hr='11')
@@ -130,6 +183,22 @@ POSTHOOK: Lineage: tstsrc.key SIMPLE [(s
 POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
 POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
 POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
+PREHOOK: query: SHOW LOCKS tstsrcpart
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrcpart
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
+PREHOOK: query: SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11')
+PREHOOK: type: SHOWLOCKS
+POSTHOOK: query: SHOW LOCKS tstsrcpart PARTITION(ds='2008-04-08', hr='11')
+POSTHOOK: type: SHOWLOCKS
+POSTHOOK: Lineage: tstsrc.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrc.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).key SIMPLE [(srcpart)srcpart.FieldSchema(name:key,
type:string, comment:default), ]
+POSTHOOK: Lineage: tstsrcpart PARTITION(ds=2008-04-08,hr=11).value SIMPLE [(srcpart)srcpart.FieldSchema(name:value,
type:string, comment:default), ]
 PREHOOK: query: drop table tstsrc
 PREHOOK: type: DROPTABLE
 PREHOOK: Input: default@tstsrc



Mime
View raw message