hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zs...@apache.org
Subject svn commit: r905383 - in /hadoop/hive/trunk: ./ metastore/if/ metastore/src/gen-cpp/ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ metastore/src/gen-php/ metastore/src/gen-py/hive_metastore/ metastore/src/java/org/apache/hadoop/hive/...
Date Mon, 01 Feb 2010 19:30:10 GMT
Author: zshao
Date: Mon Feb  1 19:30:09 2010
New Revision: 905383

URL: http://svn.apache.org/viewvc?rev=905383&view=rev
Log:
HIVE-1068. CREATE VIEW followup: add a 'table type' enum attribute in metastore's MTable. (John Sichi via zshao)

Added:
    hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TableType.java
Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/metastore/if/hive_metastore.thrift
    hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.cpp
    hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.h
    hadoop/hive/trunk/metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java
    hadoop/hive/trunk/metastore/src/gen-php/hive_metastore_types.php
    hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py
    hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
    hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java
    hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
    hadoop/hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MTable.java
    hadoop/hive/trunk/metastore/src/model/package.jdo
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_view.q
    hadoop/hive/trunk/ql/src/test/results/clientpositive/create_view.q.out
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Mon Feb  1 19:30:09 2010
@@ -40,6 +40,9 @@
     HIVE-1109. Structured temporary directories
     (Zheng Shao via Ning Zhang)
 
+    HIVE-1068. CREATE VIEW followup: add a 'table type' enum attribute in
+    metastore's MTable. (John Sichi via zshao)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/hive/trunk/metastore/if/hive_metastore.thrift
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/if/hive_metastore.thrift?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/if/hive_metastore.thrift (original)
+++ hadoop/hive/trunk/metastore/if/hive_metastore.thrift Mon Feb  1 19:30:09 2010
@@ -74,7 +74,8 @@
   8: list<FieldSchema> partitionKeys, // partition keys of the table. only primitive types are supported
   9: map<string, string> parameters,   // to store comments or any other user level parameters
   10: string viewOriginalText,         // original view text, null for non-view
-  11: string viewExpandedText          // expanded view text, null for non-view
+  11: string viewExpandedText,         // expanded view text, null for non-view
+  12: string tableType                 // table type enum, e.g. EXTERNAL_TABLE
 }
 
 struct Partition {

Modified: hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.cpp
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.cpp?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.cpp (original)
+++ hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.cpp Mon Feb  1 19:30:09 2010
@@ -728,8 +728,8 @@
   return xfer;
 }
 
-const char* Table::ascii_fingerprint = "CBD4F726F025A868EEB3BDC4028F3D66";
-const uint8_t Table::binary_fingerprint[16] = {0xCB,0xD4,0xF7,0x26,0xF0,0x25,0xA8,0x68,0xEE,0xB3,0xBD,0xC4,0x02,0x8F,0x3D,0x66};
+const char* Table::ascii_fingerprint = "F709D087CEEE7C49380296E3B423FF76";
+const uint8_t Table::binary_fingerprint[16] = {0xF7,0x09,0xD0,0x87,0xCE,0xEE,0x7C,0x49,0x38,0x02,0x96,0xE3,0xB4,0x23,0xFF,0x76};
 
 uint32_t Table::read(apache::thrift::protocol::TProtocol* iprot) {
 
@@ -866,6 +866,14 @@
           xfer += iprot->skip(ftype);
         }
         break;
+      case 12:
+        if (ftype == apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->tableType);
+          this->__isset.tableType = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -931,6 +939,9 @@
   xfer += oprot->writeFieldBegin("viewExpandedText", apache::thrift::protocol::T_STRING, 11);
   xfer += oprot->writeString(this->viewExpandedText);
   xfer += oprot->writeFieldEnd();
+  xfer += oprot->writeFieldBegin("tableType", apache::thrift::protocol::T_STRING, 12);
+  xfer += oprot->writeString(this->tableType);
+  xfer += oprot->writeFieldEnd();
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
   return xfer;

Modified: hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.h
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.h?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.h (original)
+++ hadoop/hive/trunk/metastore/src/gen-cpp/hive_metastore_types.h Mon Feb  1 19:30:09 2010
@@ -345,10 +345,10 @@
 class Table {
  public:
 
-  static const char* ascii_fingerprint; // = "CBD4F726F025A868EEB3BDC4028F3D66";
-  static const uint8_t binary_fingerprint[16]; // = {0xCB,0xD4,0xF7,0x26,0xF0,0x25,0xA8,0x68,0xEE,0xB3,0xBD,0xC4,0x02,0x8F,0x3D,0x66};
+  static const char* ascii_fingerprint; // = "F709D087CEEE7C49380296E3B423FF76";
+  static const uint8_t binary_fingerprint[16]; // = {0xF7,0x09,0xD0,0x87,0xCE,0xEE,0x7C,0x49,0x38,0x02,0x96,0xE3,0xB4,0x23,0xFF,0x76};
 
-  Table() : tableName(""), dbName(""), owner(""), createTime(0), lastAccessTime(0), retention(0), viewOriginalText(""), viewExpandedText("") {
+  Table() : tableName(""), dbName(""), owner(""), createTime(0), lastAccessTime(0), retention(0), viewOriginalText(""), viewExpandedText(""), tableType("") {
   }
 
   virtual ~Table() throw() {}
@@ -364,9 +364,10 @@
   std::map<std::string, std::string>  parameters;
   std::string viewOriginalText;
   std::string viewExpandedText;
+  std::string tableType;
 
   struct __isset {
-    __isset() : tableName(false), dbName(false), owner(false), createTime(false), lastAccessTime(false), retention(false), sd(false), partitionKeys(false), parameters(false), viewOriginalText(false), viewExpandedText(false) {}
+    __isset() : tableName(false), dbName(false), owner(false), createTime(false), lastAccessTime(false), retention(false), sd(false), partitionKeys(false), parameters(false), viewOriginalText(false), viewExpandedText(false), tableType(false) {}
     bool tableName;
     bool dbName;
     bool owner;
@@ -378,6 +379,7 @@
     bool parameters;
     bool viewOriginalText;
     bool viewExpandedText;
+    bool tableType;
   } __isset;
 
   bool operator == (const Table & rhs) const
@@ -404,6 +406,8 @@
       return false;
     if (!(viewExpandedText == rhs.viewExpandedText))
       return false;
+    if (!(tableType == rhs.tableType))
+      return false;
     return true;
   }
   bool operator != (const Table &rhs) const {

Modified: hadoop/hive/trunk/metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java (original)
+++ hadoop/hive/trunk/metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java Mon Feb  1 19:30:09 2010
@@ -31,6 +31,7 @@
   private static final TField PARAMETERS_FIELD_DESC = new TField("parameters", TType.MAP, (short)9);
   private static final TField VIEW_ORIGINAL_TEXT_FIELD_DESC = new TField("viewOriginalText", TType.STRING, (short)10);
   private static final TField VIEW_EXPANDED_TEXT_FIELD_DESC = new TField("viewExpandedText", TType.STRING, (short)11);
+  private static final TField TABLE_TYPE_FIELD_DESC = new TField("tableType", TType.STRING, (short)12);
 
   private String tableName;
   public static final int TABLENAME = 1;
@@ -54,6 +55,8 @@
   public static final int VIEWORIGINALTEXT = 10;
   private String viewExpandedText;
   public static final int VIEWEXPANDEDTEXT = 11;
+  private String tableType;
+  public static final int TABLETYPE = 12;
 
   private final Isset __isset = new Isset();
   private static final class Isset implements java.io.Serializable {
@@ -88,6 +91,8 @@
         new FieldValueMetaData(TType.STRING)));
     put(VIEWEXPANDEDTEXT, new FieldMetaData("viewExpandedText", TFieldRequirementType.DEFAULT, 
         new FieldValueMetaData(TType.STRING)));
+    put(TABLETYPE, new FieldMetaData("tableType", TFieldRequirementType.DEFAULT, 
+        new FieldValueMetaData(TType.STRING)));
   }});
 
   static {
@@ -108,7 +113,8 @@
     List<FieldSchema> partitionKeys,
     Map<String,String> parameters,
     String viewOriginalText,
-    String viewExpandedText)
+    String viewExpandedText,
+    String tableType)
   {
     this();
     this.tableName = tableName;
@@ -125,6 +131,7 @@
     this.parameters = parameters;
     this.viewOriginalText = viewOriginalText;
     this.viewExpandedText = viewExpandedText;
+    this.tableType = tableType;
   }
 
   /**
@@ -177,6 +184,9 @@
     if (other.isSetViewExpandedText()) {
       this.viewExpandedText = other.viewExpandedText;
     }
+    if (other.isSetTableType()) {
+      this.tableType = other.tableType;
+    }
   }
 
   @Override
@@ -400,6 +410,23 @@
     return this.viewExpandedText != null;
   }
 
+  public String getTableType() {
+    return this.tableType;
+  }
+
+  public void setTableType(String tableType) {
+    this.tableType = tableType;
+  }
+
+  public void unsetTableType() {
+    this.tableType = null;
+  }
+
+  // Returns true if field tableType is set (has been asigned a value) and false otherwise
+  public boolean isSetTableType() {
+    return this.tableType != null;
+  }
+
   public void setFieldValue(int fieldID, Object value) {
     switch (fieldID) {
     case TABLENAME:
@@ -490,6 +517,14 @@
       }
       break;
 
+    case TABLETYPE:
+      if (value == null) {
+        unsetTableType();
+      } else {
+        setTableType((String)value);
+      }
+      break;
+
     default:
       throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
     }
@@ -530,6 +565,9 @@
     case VIEWEXPANDEDTEXT:
       return getViewExpandedText();
 
+    case TABLETYPE:
+      return getTableType();
+
     default:
       throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
     }
@@ -560,6 +598,8 @@
       return isSetViewOriginalText();
     case VIEWEXPANDEDTEXT:
       return isSetViewExpandedText();
+    case TABLETYPE:
+      return isSetTableType();
     default:
       throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
     }
@@ -677,6 +717,15 @@
         return false;
     }
 
+    boolean this_present_tableType = true && this.isSetTableType();
+    boolean that_present_tableType = true && that.isSetTableType();
+    if (this_present_tableType || that_present_tableType) {
+      if (!(this_present_tableType && that_present_tableType))
+        return false;
+      if (!this.tableType.equals(that.tableType))
+        return false;
+    }
+
     return true;
   }
 
@@ -800,6 +849,13 @@
             TProtocolUtil.skip(iprot, field.type);
           }
           break;
+        case TABLETYPE:
+          if (field.type == TType.STRING) {
+            this.tableType = iprot.readString();
+          } else { 
+            TProtocolUtil.skip(iprot, field.type);
+          }
+          break;
         default:
           TProtocolUtil.skip(iprot, field.type);
           break;
@@ -877,6 +933,11 @@
       oprot.writeString(this.viewExpandedText);
       oprot.writeFieldEnd();
     }
+    if (this.tableType != null) {
+      oprot.writeFieldBegin(TABLE_TYPE_FIELD_DESC);
+      oprot.writeString(this.tableType);
+      oprot.writeFieldEnd();
+    }
     oprot.writeFieldStop();
     oprot.writeStructEnd();
   }
@@ -961,6 +1022,14 @@
       sb.append(this.viewExpandedText);
     }
     first = false;
+    if (!first) sb.append(", ");
+    sb.append("tableType:");
+    if (this.tableType == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.tableType);
+    }
+    first = false;
     sb.append(")");
     return sb.toString();
   }

Modified: hadoop/hive/trunk/metastore/src/gen-php/hive_metastore_types.php
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/gen-php/hive_metastore_types.php?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/gen-php/hive_metastore_types.php (original)
+++ hadoop/hive/trunk/metastore/src/gen-php/hive_metastore_types.php Mon Feb  1 19:30:09 2010
@@ -1089,6 +1089,7 @@
   public $parameters = null;
   public $viewOriginalText = null;
   public $viewExpandedText = null;
+  public $tableType = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -1151,6 +1152,10 @@
           'var' => 'viewExpandedText',
           'type' => TType::STRING,
           ),
+        12 => array(
+          'var' => 'tableType',
+          'type' => TType::STRING,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -1187,6 +1192,9 @@
       if (isset($vals['viewExpandedText'])) {
         $this->viewExpandedText = $vals['viewExpandedText'];
       }
+      if (isset($vals['tableType'])) {
+        $this->tableType = $vals['tableType'];
+      }
     }
   }
 
@@ -1311,6 +1319,13 @@
             $xfer += $input->skip($ftype);
           }
           break;
+        case 12:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->tableType);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -1407,6 +1422,11 @@
       $xfer += $output->writeString($this->viewExpandedText);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->tableType !== null) {
+      $xfer += $output->writeFieldBegin('tableType', TType::STRING, 12);
+      $xfer += $output->writeString($this->tableType);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

Modified: hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py (original)
+++ hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py Mon Feb  1 19:30:09 2010
@@ -706,6 +706,7 @@
    - parameters
    - viewOriginalText
    - viewExpandedText
+   - tableType
   """
 
   thrift_spec = (
@@ -721,9 +722,10 @@
     (9, TType.MAP, 'parameters', (TType.STRING,None,TType.STRING,None), None, ), # 9
     (10, TType.STRING, 'viewOriginalText', None, None, ), # 10
     (11, TType.STRING, 'viewExpandedText', None, None, ), # 11
+    (12, TType.STRING, 'tableType', None, None, ), # 12
   )
 
-  def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, lastAccessTime=None, retention=None, sd=None, partitionKeys=None, parameters=None, viewOriginalText=None, viewExpandedText=None,):
+  def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, lastAccessTime=None, retention=None, sd=None, partitionKeys=None, parameters=None, viewOriginalText=None, viewExpandedText=None, tableType=None,):
     self.tableName = tableName
     self.dbName = dbName
     self.owner = owner
@@ -735,6 +737,7 @@
     self.parameters = parameters
     self.viewOriginalText = viewOriginalText
     self.viewExpandedText = viewExpandedText
+    self.tableType = tableType
 
   def read(self, iprot):
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -813,6 +816,11 @@
           self.viewExpandedText = iprot.readString();
         else:
           iprot.skip(ftype)
+      elif fid == 12:
+        if ftype == TType.STRING:
+          self.tableType = iprot.readString();
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -874,6 +882,10 @@
       oprot.writeFieldBegin('viewExpandedText', TType.STRING, 11)
       oprot.writeString(self.viewExpandedText)
       oprot.writeFieldEnd()
+    if self.tableType != None:
+      oprot.writeFieldBegin('tableType', TType.STRING, 12)
+      oprot.writeString(self.tableType)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
 

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Mon Feb  1 19:30:09 2010
@@ -311,18 +311,21 @@
       boolean success = false, madeDir = false;
       try {
         getMS().openTransaction();
-        if (tbl.getSd().getLocation() == null
+        if (!TableType.VIRTUAL_VIEW.toString().equals(tbl.getTableType())) {
+          if (tbl.getSd().getLocation() == null
             || tbl.getSd().getLocation().isEmpty()) {
-          tblPath = wh.getDefaultTablePath(tbl.getDbName(), tbl.getTableName());
-        } else {
-          if (!isExternal(tbl)) {
-            LOG.warn("Location: " + tbl.getSd().getLocation()
+            tblPath = wh.getDefaultTablePath(
+              tbl.getDbName(), tbl.getTableName());
+          } else {
+            if (!isExternal(tbl)) {
+              LOG.warn("Location: " + tbl.getSd().getLocation()
                 + "specified for non-external table:" + tbl.getTableName());
+            }
+            tblPath = wh.getDnsPath(new Path(tbl.getSd().getLocation()));
           }
-          tblPath = wh.getDnsPath(new Path(tbl.getSd().getLocation()));
-        }
 
-        tbl.getSd().setLocation(tblPath.toString());
+          tbl.getSd().setLocation(tblPath.toString());
+        }
 
         // get_table checks whether database exists, it should be moved here
         if (is_table_exists(tbl.getDbName(), tbl.getTableName())) {
@@ -330,12 +333,14 @@
               + " already exists");
         }
 
-        if (!wh.isDir(tblPath)) {
-          if (!wh.mkdirs(tblPath)) {
-            throw new MetaException(tblPath
+        if (tblPath != null) {
+          if (!wh.isDir(tblPath)) {
+            if (!wh.mkdirs(tblPath)) {
+              throw new MetaException(tblPath
                 + " is not a directory or unable to create one");
+            }
+            madeDir = true;
           }
-          madeDir = true;
         }
 
         // set create time
@@ -381,11 +386,13 @@
         if (tbl == null) {
           throw new NoSuchObjectException(name + " doesn't exist");
         }
-        if (tbl.getSd() == null || tbl.getSd().getLocation() == null) {
+        if (tbl.getSd() == null) {
           throw new MetaException("Table metadata is corrupted");
         }
         isExternal = isExternal(tbl);
-        tblPath = new Path(tbl.getSd().getLocation());
+        if (tbl.getSd().getLocation() != null) {
+          tblPath = new Path(tbl.getSd().getLocation());
+        }
         if (!getMS().dropTable(dbname, name)) {
           throw new MetaException("Unable to drop table");
         }
@@ -705,9 +712,9 @@
       } catch (NoSuchObjectException e) {
         throw new UnknownTableException(e.getMessage());
       }
-      boolean isNative = SerDeUtils.isNativeSerDe(tbl.getSd().getSerdeInfo()
-          .getSerializationLib());
-      if (isNative) {
+      boolean getColsFromSerDe = SerDeUtils.shouldGetColsFromSerDe(
+        tbl.getSd().getSerdeInfo().getSerializationLib());
+      if (!getColsFromSerDe) {
         return tbl.getSd().getCols();
       } else {
         try {

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java Mon Feb  1 19:30:09 2010
@@ -189,6 +189,9 @@
   static public Deserializer getDeserializer(Configuration conf,
       org.apache.hadoop.hive.metastore.api.Table table) throws MetaException {
     String lib = table.getSd().getSerdeInfo().getSerializationLib();
+    if (lib == null) {
+      return null;
+    }
     try {
       Deserializer deserializer = SerDeUtils.lookupDeserializer(lib);
       deserializer.initialize(conf, MetaStoreUtils.getSchema(table));

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java Mon Feb  1 19:30:09 2010
@@ -581,11 +581,23 @@
     if (mtbl == null) {
       return null;
     }
+    String tableType = mtbl.getTableType();
+    if (tableType == null) {
+      // for backwards compatibility with old metastore persistence
+      if (mtbl.getViewOriginalText() != null) {
+        tableType = TableType.VIRTUAL_VIEW.toString();
+      } else if ("TRUE".equals(mtbl.getParameters().get("EXTERNAL"))) {
+        tableType = TableType.EXTERNAL_TABLE.toString();
+      } else {
+        tableType = TableType.MANAGED_TABLE.toString();
+      }
+    }
     return new Table(mtbl.getTableName(), mtbl.getDatabase().getName(), mtbl
         .getOwner(), mtbl.getCreateTime(), mtbl.getLastAccessTime(), mtbl
         .getRetention(), convertToStorageDescriptor(mtbl.getSd()),
         convertToFieldSchemas(mtbl.getPartitionKeys()), mtbl.getParameters(),
-        mtbl.getViewOriginalText(), mtbl.getViewExpandedText());
+        mtbl.getViewOriginalText(), mtbl.getViewExpandedText(),
+        tableType);
   }
 
   private MTable convertToMTable(Table tbl) throws InvalidObjectException,
@@ -605,7 +617,8 @@
         convertToMStorageDescriptor(tbl.getSd()), tbl.getOwner(), tbl
             .getCreateTime(), tbl.getLastAccessTime(), tbl.getRetention(),
         convertToMFieldSchemas(tbl.getPartitionKeys()), tbl.getParameters(),
-        tbl.getViewOriginalText(), tbl.getViewExpandedText());
+        tbl.getViewOriginalText(), tbl.getViewExpandedText(),
+        tbl.getTableType());
   }
 
   private List<MFieldSchema> convertToMFieldSchemas(List<FieldSchema> keys) {

Added: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TableType.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TableType.java?rev=905383&view=auto
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TableType.java (added)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TableType.java Mon Feb  1 19:30:09 2010
@@ -0,0 +1,26 @@
+/**
+ * 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.metastore;
+
+/**
+ * Typesafe enum for types of tables described by the metastore.
+ */
+public enum TableType {
+  MANAGED_TABLE, EXTERNAL_TABLE, VIRTUAL_VIEW
+}

Modified: hadoop/hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MTable.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MTable.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MTable.java (original)
+++ hadoop/hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MTable.java Mon Feb  1 19:30:09 2010
@@ -34,6 +34,7 @@
   private Map<String, String> parameters;
   private String viewOriginalText;
   private String viewExpandedText;
+  private String tableType;
 
   public MTable() {}
 
@@ -47,11 +48,14 @@
    * @param retention
    * @param partitionKeys
    * @param parameters
+   * @param viewOriginalText
+   * @param viewExpandedText
+   * @param tableType
    */
   public MTable(String tableName, MDatabase database, MStorageDescriptor sd, String owner,
       int createTime, int lastAccessTime, int retention, List<MFieldSchema> partitionKeys,
       Map<String, String> parameters,
-      String viewOriginalText, String viewExpandedText) {
+      String viewOriginalText, String viewExpandedText, String tableType) {
     this.tableName = tableName;
     this.database = database;
     this.sd = sd;
@@ -63,6 +67,7 @@
     this.parameters = parameters;
     this.viewOriginalText = viewOriginalText;
     this.viewExpandedText = viewExpandedText;
+    this.tableType = tableType;
   }
 
   /**
@@ -219,5 +224,17 @@
     return lastAccessTime;
   }
 
-  
+  /**
+   * @param tableType the tableType to set
+   */
+  public void setTableType(String tableType) {
+    this.tableType = tableType;
+  }
+
+  /**
+   * @return the tableType
+   */
+  public String getTableType() {
+    return tableType;
+  }
 }

Modified: hadoop/hive/trunk/metastore/src/model/package.jdo
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/model/package.jdo?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/model/package.jdo (original)
+++ hadoop/hive/trunk/metastore/src/model/package.jdo Mon Feb  1 19:30:09 2010
@@ -131,6 +131,9 @@
       <field name="viewExpandedText">
         <column name="VIEW_EXPANDED_TEXT" jdbc-type="LONGVARCHAR"/>
       </field>
+      <field name="tableType">
+        <column name="TBL_TYPE" length="128" jdbc-type="VARCHAR"/>
+      </field>
     </class>
 
     <class name="MSerDeInfo" identity-type="datastore" table="SERDES" detachable="true">

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java Mon Feb  1 19:30:09 2010
@@ -46,6 +46,7 @@
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.metastore.MetaStoreUtils;
+import org.apache.hadoop.hive.metastore.TableType;
 import org.apache.hadoop.hive.metastore.Warehouse;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
 import org.apache.hadoop.hive.metastore.api.InvalidOperationException;
@@ -1344,6 +1345,7 @@
 
     if (crtTbl.isExternal()) {
       tbl.setProperty("EXTERNAL", "TRUE");
+      tbl.setTableType(TableType.EXTERNAL_TABLE);
     }
 
     // If the sorted columns is a superset of bucketed columns, store this fact.
@@ -1446,6 +1448,9 @@
    */
   private int createView(Hive db, CreateViewDesc crtView) throws HiveException {
     Table tbl = new Table(crtView.getViewName());
+    tbl.setTableType(TableType.VIRTUAL_VIEW);
+    tbl.setSerializationLib(null);
+    tbl.getTTable().getSd().getSerdeInfo().getParameters().clear();
     tbl.setViewOriginalText(crtView.getViewOriginalText());
     tbl.setViewExpandedText(crtView.getViewExpandedText());
     tbl.setFields(crtView.getSchema());

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java Mon Feb  1 19:30:09 2010
@@ -427,9 +427,10 @@
       // of type "array<string>". This happens when the table is created using
       // an
       // earlier version of Hive.
-      if (tTable.getSd().getSerdeInfo().getSerializationLib().equals(
+      if (
           org.apache.hadoop.hive.serde2.MetadataTypedColumnsetSerDe.class
-              .getName())
+          .getName().equals(
+            tTable.getSd().getSerdeInfo().getSerializationLib())
           && tTable.getSd().getColsSize() > 0
           && tTable.getSd().getCols().get(0).getType().indexOf('<') == -1) {
         tTable.getSd().getSerdeInfo().setSerializationLib(

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java Mon Feb  1 19:30:09 2010
@@ -34,6 +34,7 @@
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.common.JavaUtils;
 import org.apache.hadoop.hive.metastore.MetaStoreUtils;
+import org.apache.hadoop.hive.metastore.TableType;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
 import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.apache.hadoop.hive.metastore.api.Order;
@@ -143,6 +144,8 @@
     sd.setSortCols(new ArrayList<Order>());
 
     sd.getSerdeInfo().setParameters(new HashMap<String, String>());
+
+    setTableType(TableType.MANAGED_TABLE);
   }
 
   public void reinitSerDe() throws HiveException {
@@ -188,6 +191,14 @@
       }
     }
 
+    if (isView()) {
+      assert(getViewOriginalText() != null);
+      assert(getViewExpandedText() != null);
+    } else {
+      assert(getViewOriginalText() == null);
+      assert(getViewExpandedText() == null);
+    }
+    
     Iterator<FieldSchema> iterCols = getCols().iterator();
     List<String> colNames = new ArrayList<String>();
     while (iterCols.hasNext()) {
@@ -310,6 +321,14 @@
     return getTTable().getParameters().get(name);
   }
 
+  public void setTableType(TableType tableType) {
+     getTTable().setTableType(tableType.toString());
+   }
+
+  public TableType getTableType() {
+     return Enum.valueOf(TableType.class, getTTable().getTableType());
+   }
+
   public ArrayList<StructField> getFields() {
 
     ArrayList<StructField> fields = new ArrayList<StructField>();
@@ -442,8 +461,9 @@
   }
 
   public List<FieldSchema> getCols() {
-    boolean isNative = SerDeUtils.isNativeSerDe(getSerializationLib());
-    if (isNative) {
+    boolean getColsFromSerDe = SerDeUtils.shouldGetColsFromSerDe(
+      getSerializationLib());
+    if (!getColsFromSerDe) {
       return getTTable().getSd().getCols();
     } else {
       try {
@@ -653,12 +673,7 @@
    * @return whether this table is actually a view
    */
   public boolean isView() {
-    // either both attributes (expandedText and originalText) should
-    // be set, or neither
-    boolean hasExpandedText = (getViewExpandedText() != null);
-    boolean hasOriginalText = (getViewOriginalText() != null);
-    assert (hasExpandedText == hasOriginalText);
-    return hasExpandedText;
+    return TableType.VIRTUAL_VIEW.equals(getTableType());
   }
 
   /**

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java Mon Feb  1 19:30:09 2010
@@ -6198,7 +6198,7 @@
     if ((crtTblDesc.getCols() == null) || (crtTblDesc.getCols().size() == 0)) {
       // for now make sure that serde exists
       if (StringUtils.isEmpty(crtTblDesc.getSerName())
-          || SerDeUtils.isNativeSerDe(crtTblDesc.getSerName())) {
+          || !SerDeUtils.shouldGetColsFromSerDe(crtTblDesc.getSerName())) {
         throw new SemanticException(ErrorMsg.INVALID_TBL_DDL_SERDE.getMsg());
       }
       return;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_view.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_view.q?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_view.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_view.q Mon Feb  1 19:30:09 2010
@@ -43,6 +43,16 @@
 
 CREATE TABLE table1 (key int);
 
+-- use DESCRIBE EXTENDED on a base table and an external table as points
+-- of comparison for view descriptions
+DESCRIBE EXTENDED table1;
+DESCRIBE EXTENDED src1;
+
+-- use DESCRIBE EXTENDED on a base table as a point of comparison for
+-- view descriptions
+DESCRIBE EXTENDED table1;
+
+
 INSERT OVERWRITE TABLE table1 SELECT key FROM src WHERE key = 86;
 
 SELECT * FROM table1;
@@ -60,9 +70,9 @@
 SELECT * FROM view5;
 DESCRIBE view5;
 
--- verify that column name and comment in DDL portion 
+-- verify that column name and comment in DDL portion
 -- overrides column alias in SELECT
-CREATE VIEW view6(valoo COMMENT 'I cannot spell') AS 
+CREATE VIEW view6(valoo COMMENT 'I cannot spell') AS
 SELECT upper(value) as blarg FROM src WHERE key=86;
 DESCRIBE view6;
 
@@ -87,16 +97,16 @@
 SELECT * FROM view7 LIMIT 20;
 
 -- test usage of a function within a view
-CREATE TEMPORARY FUNCTION test_translate AS 
+CREATE TEMPORARY FUNCTION test_translate AS
 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFTestTranslate';
 CREATE VIEW view8(c) AS
-SELECT test_translate('abc', 'a', 'b') 
+SELECT test_translate('abc', 'a', 'b')
 FROM table1;
 DESCRIBE EXTENDED view8;
 SELECT * FROM view8;
 
 -- test usage of a UDAF within a view
-CREATE TEMPORARY FUNCTION test_max AS 
+CREATE TEMPORARY FUNCTION test_max AS
 'org.apache.hadoop.hive.ql.udf.UDAFTestMax';
 CREATE VIEW view9(m) AS
 SELECT test_max(length(value))
@@ -111,7 +121,7 @@
 SELECT * FROM view10;
 
 -- test usage of a UDTF within a view
-CREATE TEMPORARY FUNCTION test_explode AS 
+CREATE TEMPORARY FUNCTION test_explode AS
 'org.apache.hadoop.hive.ql.udf.generic.GenericUDTFExplode';
 CREATE VIEW view11 AS
 SELECT test_explode(array(1,2,3)) AS (boom)
@@ -140,14 +150,14 @@
 
 -- test usage of JOIN+UNION+AGG all within same view
 CREATE VIEW view14 AS
-SELECT unionsrc1.key as k1, unionsrc1.value as v1, 
+SELECT unionsrc1.key as k1, unionsrc1.value as v1,
        unionsrc2.key as k2, unionsrc2.value as v2
 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
-                         UNION  ALL  
-      select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1 
-JOIN 
+                         UNION  ALL
+      select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1
+JOIN
      (select 'tst1' as key, cast(count(1) as string) as value from src s3
-                         UNION  ALL  
+                         UNION  ALL
       select s4.key as key, s4.value as value from src s4 where s4.key < 10) unionsrc2
 ON (unionsrc1.key = unionsrc2.key);
 DESCRIBE EXTENDED view14;

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/create_view.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/create_view.q.out?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/create_view.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/create_view.q.out Mon Feb  1 19:30:09 2010
@@ -73,60 +73,60 @@
 PREHOOK: query: SELECT * FROM src WHERE key=86
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2036484660/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1600701811/10000
 POSTHOOK: query: SELECT * FROM src WHERE key=86
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2036484660/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1600701811/10000
 86	val_86
 PREHOOK: query: CREATE VIEW view1 AS SELECT value FROM src WHERE key=86
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1340766001/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1774941594/10000
 POSTHOOK: query: CREATE VIEW view1 AS SELECT value FROM src WHERE key=86
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1340766001/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1774941594/10000
 POSTHOOK: Output: default@view1
 PREHOOK: query: CREATE VIEW view2 AS SELECT * FROM src
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1473375524/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/557479374/10000
 POSTHOOK: query: CREATE VIEW view2 AS SELECT * FROM src
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1473375524/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/557479374/10000
 POSTHOOK: Output: default@view2
 PREHOOK: query: CREATE VIEW view3(valoo) AS SELECT upper(value) FROM src WHERE key=86
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1011189667/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/543421203/10000
 POSTHOOK: query: CREATE VIEW view3(valoo) AS SELECT upper(value) FROM src WHERE key=86
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1011189667/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/543421203/10000
 POSTHOOK: Output: default@view3
 PREHOOK: query: SELECT * from view1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2079205631/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/728576887/10000
 POSTHOOK: query: SELECT * from view1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2079205631/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/728576887/10000
 val_86
 PREHOOK: query: SELECT * from view2 where key=18
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/373812205/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/850967798/10000
 POSTHOOK: query: SELECT * from view2 where key=18
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/373812205/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/850967798/10000
 18	val_18
 18	val_18
 PREHOOK: query: SELECT * from view3
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/791707754/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1364208710/10000
 POSTHOOK: query: SELECT * from view3
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/791707754/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1364208710/10000
 VAL_86
 PREHOOK: query: -- test EXPLAIN output for CREATE VIEW
 EXPLAIN
@@ -227,7 +227,7 @@
 POSTHOOK: type: DESCTABLE
 value	string	
 	 	 
-Detailed Table Information	Table(tableName:view1, dbName:default, owner:jsichi, createTime:1263943718, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:value, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view1, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943718}, viewOriginalText:SELECT value FROM src WHERE key=86, viewExpandedText:SELECT `src`.`value` FROM `src` WHERE `src`.`key`=86)	
+Detailed Table Information	Table(tableName:view1, dbName:default, owner:jsichi, createTime:1264709888, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:value, type:string, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709888}, viewOriginalText:SELECT value FROM src WHERE key=86, viewExpandedText:SELECT `src`.`value` FROM `src` WHERE `src`.`key`=86, tableType:VIRTUAL_VIEW)	
 PREHOOK: query: DESCRIBE view2
 PREHOOK: type: DESCTABLE
 POSTHOOK: query: DESCRIBE view2
@@ -241,7 +241,7 @@
 key	string	
 value	string	
 	 	 
-Detailed Table Information	Table(tableName:view2, dbName:default, owner:jsichi, createTime:1263943718, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view2, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943718}, viewOriginalText:SELECT * FROM src, viewExpandedText:SELECT `src`.`key`, `src`.`value` FROM `src`)	
+Detailed Table Information	Table(tableName:view2, dbName:default, owner:jsichi, createTime:1264709888, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709888}, viewOriginalText:SELECT * FROM src, viewExpandedText:SELECT `src`.`key`, `src`.`value` FROM `src`, tableType:VIRTUAL_VIEW)	
 PREHOOK: query: DESCRIBE view3
 PREHOOK: type: DESCTABLE
 POSTHOOK: query: DESCRIBE view3
@@ -253,12 +253,42 @@
 POSTHOOK: type: DESCTABLE
 valoo	string	
 	 	 
-Detailed Table Information	Table(tableName:view3, dbName:default, owner:jsichi, createTime:1263943719, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:valoo, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view3, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943719}, viewOriginalText:SELECT upper(value) FROM src WHERE key=86, viewExpandedText:SELECT `_c0` AS `valoo` FROM (SELECT upper(`src`.`value`) FROM `src` WHERE `src`.`key`=86) `view3`)	
+Detailed Table Information	Table(tableName:view3, dbName:default, owner:jsichi, createTime:1264709888, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:valoo, type:string, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709888}, viewOriginalText:SELECT upper(value) FROM src WHERE key=86, viewExpandedText:SELECT `_c0` AS `valoo` FROM (SELECT upper(`src`.`value`) FROM `src` WHERE `src`.`key`=86) `view3`, tableType:VIRTUAL_VIEW)	
 PREHOOK: query: CREATE TABLE table1 (key int)
 PREHOOK: type: CREATETABLE
 POSTHOOK: query: CREATE TABLE table1 (key int)
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: default@table1
+PREHOOK: query: -- use DESCRIBE EXTENDED on a base table and an external table as points
+-- of comparison for view descriptions
+DESCRIBE EXTENDED table1
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: -- use DESCRIBE EXTENDED on a base table and an external table as points
+-- of comparison for view descriptions
+DESCRIBE EXTENDED table1
+POSTHOOK: type: DESCTABLE
+key	int	
+	 	 
+Detailed Table Information	Table(tableName:table1, dbName:default, owner:jsichi, createTime:1264709897, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:int, comment:null)], location:file:/data/users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/table1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709897}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)	
+PREHOOK: query: DESCRIBE EXTENDED src1
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: DESCRIBE EXTENDED src1
+POSTHOOK: type: DESCTABLE
+key	string	default
+value	string	default
+	 	 
+Detailed Table Information	Table(tableName:src1, dbName:default, owner:null, createTime:1264709884, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:value, type:string, comment:default)], location:file:/data/users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/src1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709884}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)	
+PREHOOK: query: -- use DESCRIBE EXTENDED on a base table as a point of comparison for
+-- view descriptions
+DESCRIBE EXTENDED table1
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: -- use DESCRIBE EXTENDED on a base table as a point of comparison for
+-- view descriptions
+DESCRIBE EXTENDED table1
+POSTHOOK: type: DESCTABLE
+key	int	
+	 	 
+Detailed Table Information	Table(tableName:table1, dbName:default, owner:jsichi, createTime:1264709897, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:int, comment:null)], location:file:/data/users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/table1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709897}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)	
 PREHOOK: query: INSERT OVERWRITE TABLE table1 SELECT key FROM src WHERE key = 86
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
@@ -270,27 +300,27 @@
 PREHOOK: query: SELECT * FROM table1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@table1
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1721850602/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/2141444732/10000
 POSTHOOK: query: SELECT * FROM table1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@table1
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1721850602/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/2141444732/10000
 86
 PREHOOK: query: CREATE VIEW view4 AS SELECT * FROM table1
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/443126599/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/898468153/10000
 POSTHOOK: query: CREATE VIEW view4 AS SELECT * FROM table1
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/443126599/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/898468153/10000
 POSTHOOK: Output: default@view4
 PREHOOK: query: SELECT * FROM view4
 PREHOOK: type: QUERY
 PREHOOK: Input: default@table1
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/139304921/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/528396960/10000
 POSTHOOK: query: SELECT * FROM view4
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@table1
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/139304921/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/528396960/10000
 86
 PREHOOK: query: DESCRIBE view4
 PREHOOK: type: DESCTABLE
@@ -306,20 +336,20 @@
 PREHOOK: query: SELECT * FROM table1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@table1
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1379574584/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/987067062/10000
 POSTHOOK: query: SELECT * FROM table1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@table1
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1379574584/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/987067062/10000
 86	NULL
 PREHOOK: query: SELECT * FROM view4
 PREHOOK: type: QUERY
 PREHOOK: Input: default@table1
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2005065906/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1541942127/10000
 POSTHOOK: query: SELECT * FROM view4
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@table1
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2005065906/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1541942127/10000
 86
 PREHOOK: query: DESCRIBE table1
 PREHOOK: type: DESCTABLE
@@ -335,20 +365,20 @@
 PREHOOK: query: CREATE VIEW view5 AS SELECT v1.key as key1, v2.key as key2
 FROM view4 v1 join view4 v2
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/491052879/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/409117872/10000
 POSTHOOK: query: CREATE VIEW view5 AS SELECT v1.key as key1, v2.key as key2
 FROM view4 v1 join view4 v2
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/491052879/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/409117872/10000
 POSTHOOK: Output: default@view5
 PREHOOK: query: SELECT * FROM view5
 PREHOOK: type: QUERY
 PREHOOK: Input: default@table1
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/683346158/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1552433053/10000
 POSTHOOK: query: SELECT * FROM view5
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@table1
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/683346158/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1552433053/10000
 86	86
 PREHOOK: query: DESCRIBE view5
 PREHOOK: type: DESCTABLE
@@ -356,18 +386,18 @@
 POSTHOOK: type: DESCTABLE
 key1	int	
 key2	int	
-PREHOOK: query: -- verify that column name and comment in DDL portion 
+PREHOOK: query: -- verify that column name and comment in DDL portion
 -- overrides column alias in SELECT
-CREATE VIEW view6(valoo COMMENT 'I cannot spell') AS 
+CREATE VIEW view6(valoo COMMENT 'I cannot spell') AS
 SELECT upper(value) as blarg FROM src WHERE key=86
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1793790099/10000
-POSTHOOK: query: -- verify that column name and comment in DDL portion 
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/620020128/10000
+POSTHOOK: query: -- verify that column name and comment in DDL portion
 -- overrides column alias in SELECT
-CREATE VIEW view6(valoo COMMENT 'I cannot spell') AS 
+CREATE VIEW view6(valoo COMMENT 'I cannot spell') AS
 SELECT upper(value) as blarg FROM src WHERE key=86
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1793790099/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/620020128/10000
 POSTHOOK: Output: default@view6
 PREHOOK: query: DESCRIBE view6
 PREHOOK: type: DESCTABLE
@@ -381,7 +411,7 @@
 ORDER BY key, value
 LIMIT 10
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/32355987/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/339578208/10000
 POSTHOOK: query: -- verify that ORDER BY and LIMIT are both supported in view def
 CREATE VIEW view7 AS
 SELECT * FROM src
@@ -389,16 +419,16 @@
 ORDER BY key, value
 LIMIT 10
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/32355987/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/339578208/10000
 POSTHOOK: Output: default@view7
 PREHOOK: query: SELECT * FROM view7
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/781480442/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/242830582/10000
 POSTHOOK: query: SELECT * FROM view7
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/781480442/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/242830582/10000
 82	val_82
 83	val_83
 83	val_83
@@ -415,14 +445,14 @@
 SELECT * FROM view7 ORDER BY key DESC, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/217718183/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1636014325/10000
 POSTHOOK: query: -- top-level ORDER BY should override the one inside the view
 -- (however, the inside ORDER BY should still influence the evaluation
 -- of the limit)
 SELECT * FROM view7 ORDER BY key DESC, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/217718183/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1636014325/10000
 90	val_90
 90	val_90
 87	val_87
@@ -437,12 +467,12 @@
 SELECT * FROM view7 LIMIT 5
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/23595216/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/130847292/10000
 POSTHOOK: query: -- top-level LIMIT should override if lower
 SELECT * FROM view7 LIMIT 5
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/23595216/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/130847292/10000
 82	val_82
 83	val_83
 83	val_83
@@ -452,12 +482,12 @@
 SELECT * FROM view7 LIMIT 20
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/640347133/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1942970084/10000
 POSTHOOK: query: -- but not if higher
 SELECT * FROM view7 LIMIT 20
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/640347133/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1942970084/10000
 82	val_82
 83	val_83
 83	val_83
@@ -469,23 +499,23 @@
 90	val_90
 90	val_90
 PREHOOK: query: -- test usage of a function within a view
-CREATE TEMPORARY FUNCTION test_translate AS 
+CREATE TEMPORARY FUNCTION test_translate AS
 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFTestTranslate'
 PREHOOK: type: CREATEFUNCTION
 POSTHOOK: query: -- test usage of a function within a view
-CREATE TEMPORARY FUNCTION test_translate AS 
+CREATE TEMPORARY FUNCTION test_translate AS
 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFTestTranslate'
 POSTHOOK: type: CREATEFUNCTION
 PREHOOK: query: CREATE VIEW view8(c) AS
-SELECT test_translate('abc', 'a', 'b') 
+SELECT test_translate('abc', 'a', 'b')
 FROM table1
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/921687926/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/2017981069/10000
 POSTHOOK: query: CREATE VIEW view8(c) AS
-SELECT test_translate('abc', 'a', 'b') 
+SELECT test_translate('abc', 'a', 'b')
 FROM table1
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/921687926/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/2017981069/10000
 POSTHOOK: Output: default@view8
 PREHOOK: query: DESCRIBE EXTENDED view8
 PREHOOK: type: DESCTABLE
@@ -493,36 +523,36 @@
 POSTHOOK: type: DESCTABLE
 c	string	
 	 	 
-Detailed Table Information	Table(tableName:view8, dbName:default, owner:jsichi, createTime:1263943781, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:c, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view8, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943781}, viewOriginalText:SELECT test_translate('abc', 'a', 'b') 	 
-FROM table1, viewExpandedText:SELECT `_c0` AS `c` FROM (SELECT `test_translate`('abc', 'a', 'b') 	 	 
-FROM `table1`) `view8`)		 
+Detailed Table Information	Table(tableName:view8, dbName:default, owner:jsichi, createTime:1264709925, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:c, type:string, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709925}, viewOriginalText:SELECT test_translate('abc', 'a', 'b')	 
+FROM table1, viewExpandedText:SELECT `_c0` AS `c` FROM (SELECT `test_translate`('abc', 'a', 'b')	 	 
+FROM `table1`) `view8`, tableType:VIRTUAL_VIEW)		 
 PREHOOK: query: SELECT * FROM view8
 PREHOOK: type: QUERY
 PREHOOK: Input: default@table1
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/231545801/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1776598981/10000
 POSTHOOK: query: SELECT * FROM view8
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@table1
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/231545801/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1776598981/10000
 bbc
 PREHOOK: query: -- test usage of a UDAF within a view
-CREATE TEMPORARY FUNCTION test_max AS 
+CREATE TEMPORARY FUNCTION test_max AS
 'org.apache.hadoop.hive.ql.udf.UDAFTestMax'
 PREHOOK: type: CREATEFUNCTION
 POSTHOOK: query: -- test usage of a UDAF within a view
-CREATE TEMPORARY FUNCTION test_max AS 
+CREATE TEMPORARY FUNCTION test_max AS
 'org.apache.hadoop.hive.ql.udf.UDAFTestMax'
 POSTHOOK: type: CREATEFUNCTION
 PREHOOK: query: CREATE VIEW view9(m) AS
 SELECT test_max(length(value))
 FROM src
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/390776316/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1642348691/10000
 POSTHOOK: query: CREATE VIEW view9(m) AS
 SELECT test_max(length(value))
 FROM src
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/390776316/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1642348691/10000
 POSTHOOK: Output: default@view9
 PREHOOK: query: DESCRIBE EXTENDED view9
 PREHOOK: type: DESCTABLE
@@ -530,28 +560,28 @@
 POSTHOOK: type: DESCTABLE
 m	int	
 	 	 
-Detailed Table Information	Table(tableName:view9, dbName:default, owner:jsichi, createTime:1263943787, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:m, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view9, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943787}, viewOriginalText:SELECT test_max(length(value))	 
+Detailed Table Information	Table(tableName:view9, dbName:default, owner:jsichi, createTime:1264709928, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:m, type:int, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709928}, viewOriginalText:SELECT test_max(length(value))	 
 FROM src, viewExpandedText:SELECT `_c0` AS `m` FROM (SELECT `test_max`(length(`src`.`value`))	 	 
-FROM `src`) `view9`)		 
+FROM `src`) `view9`, tableType:VIRTUAL_VIEW)		 
 PREHOOK: query: SELECT * FROM view9
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1334649030/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/2110694538/10000
 POSTHOOK: query: SELECT * FROM view9
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1334649030/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/2110694538/10000
 7
 PREHOOK: query: -- test usage of a subselect within a view
 CREATE VIEW view10 AS
 SELECT slurp.* FROM (SELECT * FROM src WHERE key=86) slurp
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/43989283/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/991232364/10000
 POSTHOOK: query: -- test usage of a subselect within a view
 CREATE VIEW view10 AS
 SELECT slurp.* FROM (SELECT * FROM src WHERE key=86) slurp
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/43989283/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/991232364/10000
 POSTHOOK: Output: default@view10
 PREHOOK: query: DESCRIBE EXTENDED view10
 PREHOOK: type: DESCTABLE
@@ -560,34 +590,34 @@
 key	string	
 value	string	
 	 	 
-Detailed Table Information	Table(tableName:view10, dbName:default, owner:jsichi, createTime:1263943794, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view10, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943794}, viewOriginalText:SELECT slurp.* FROM (SELECT * FROM src WHERE key=86) slurp, viewExpandedText:SELECT `slurp`.`key`, `slurp`.`value` FROM (SELECT `src`.`key`, `src`.`value` FROM `src` WHERE `src`.`key`=86) `slurp`)	
+Detailed Table Information	Table(tableName:view10, dbName:default, owner:jsichi, createTime:1264709931, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709931}, viewOriginalText:SELECT slurp.* FROM (SELECT * FROM src WHERE key=86) slurp, viewExpandedText:SELECT `slurp`.`key`, `slurp`.`value` FROM (SELECT `src`.`key`, `src`.`value` FROM `src` WHERE `src`.`key`=86) `slurp`, tableType:VIRTUAL_VIEW)	
 PREHOOK: query: SELECT * FROM view10
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1267833328/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1318443718/10000
 POSTHOOK: query: SELECT * FROM view10
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1267833328/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1318443718/10000
 86	val_86
 PREHOOK: query: -- test usage of a UDTF within a view
-CREATE TEMPORARY FUNCTION test_explode AS 
+CREATE TEMPORARY FUNCTION test_explode AS
 'org.apache.hadoop.hive.ql.udf.generic.GenericUDTFExplode'
 PREHOOK: type: CREATEFUNCTION
 POSTHOOK: query: -- test usage of a UDTF within a view
-CREATE TEMPORARY FUNCTION test_explode AS 
+CREATE TEMPORARY FUNCTION test_explode AS
 'org.apache.hadoop.hive.ql.udf.generic.GenericUDTFExplode'
 POSTHOOK: type: CREATEFUNCTION
 PREHOOK: query: CREATE VIEW view11 AS
 SELECT test_explode(array(1,2,3)) AS (boom)
 FROM table1
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2003604275/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1311725444/10000
 POSTHOOK: query: CREATE VIEW view11 AS
 SELECT test_explode(array(1,2,3)) AS (boom)
 FROM table1
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2003604275/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1311725444/10000
 POSTHOOK: Output: default@view11
 PREHOOK: query: DESCRIBE EXTENDED view11
 PREHOOK: type: DESCTABLE
@@ -595,17 +625,17 @@
 POSTHOOK: type: DESCTABLE
 boom	int	
 	 	 
-Detailed Table Information	Table(tableName:view11, dbName:default, owner:jsichi, createTime:1263943799, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:boom, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view11, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943799}, viewOriginalText:SELECT test_explode(array(1,2,3)) AS (boom)	 
+Detailed Table Information	Table(tableName:view11, dbName:default, owner:jsichi, createTime:1264709934, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:boom, type:int, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709934}, viewOriginalText:SELECT test_explode(array(1,2,3)) AS (boom)	 
 FROM table1, viewExpandedText:SELECT `test_explode`(array(1,2,3)) AS (`boom`)	 	 
-FROM `table1`)		 
+FROM `table1`, tableType:VIRTUAL_VIEW)		 
 PREHOOK: query: SELECT * FROM view11
 PREHOOK: type: QUERY
 PREHOOK: Input: default@table1
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1745688859/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1246951240/10000
 POSTHOOK: query: SELECT * FROM view11
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@table1
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1745688859/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1246951240/10000
 1
 2
 3
@@ -613,12 +643,12 @@
 CREATE VIEW view12 AS
 SELECT * FROM src LATERAL VIEW explode(array(1,2,3)) myTable AS myCol
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2018034043/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/2101198350/10000
 POSTHOOK: query: -- test usage of LATERAL within a view
 CREATE VIEW view12 AS
 SELECT * FROM src LATERAL VIEW explode(array(1,2,3)) myTable AS myCol
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2018034043/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/2101198350/10000
 POSTHOOK: Output: default@view12
 PREHOOK: query: DESCRIBE EXTENDED view12
 PREHOOK: type: DESCTABLE
@@ -628,43 +658,43 @@
 value	string	
 mycol	int	
 	 	 
-Detailed Table Information	Table(tableName:view12, dbName:default, owner:jsichi, createTime:1263943804, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null), FieldSchema(name:mycol, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view12, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943804}, viewOriginalText:SELECT * FROM src LATERAL VIEW explode(array(1,2,3)) myTable AS myCol, viewExpandedText:SELECT `src`.`key`, `src`.`value`, `mytable`.`mycol` FROM `src` LATERAL VIEW explode(array(1,2,3)) `myTable` AS `myCol`)	
+Detailed Table Information	Table(tableName:view12, dbName:default, owner:jsichi, createTime:1264709937, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null), FieldSchema(name:mycol, type:int, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709937}, viewOriginalText:SELECT * FROM src LATERAL VIEW explode(array(1,2,3)) myTable AS myCol, viewExpandedText:SELECT `src`.`key`, `src`.`value`, `mytable`.`mycol` FROM `src` LATERAL VIEW explode(array(1,2,3)) `myTable` AS `myCol`, tableType:VIRTUAL_VIEW)	
 PREHOOK: query: SELECT * FROM view12
 ORDER BY key ASC, myCol ASC LIMIT 1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1684641155/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1985809958/10000
 POSTHOOK: query: SELECT * FROM view12
 ORDER BY key ASC, myCol ASC LIMIT 1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1684641155/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1985809958/10000
 0	val_0	1
 PREHOOK: query: -- test usage of LATERAL with a view as the LHS
 SELECT * FROM view2 LATERAL VIEW explode(array(1,2,3)) myTable AS myCol
 ORDER BY key ASC, myCol ASC LIMIT 1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1071415453/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1381956889/10000
 POSTHOOK: query: -- test usage of LATERAL with a view as the LHS
 SELECT * FROM view2 LATERAL VIEW explode(array(1,2,3)) myTable AS myCol
 ORDER BY key ASC, myCol ASC LIMIT 1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1071415453/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1381956889/10000
 0	val_0	1
 PREHOOK: query: -- test usage of TABLESAMPLE within a view
 CREATE VIEW view13 AS
 SELECT s.key
 FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 5 ON key) s
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2052853769/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/782478113/10000
 POSTHOOK: query: -- test usage of TABLESAMPLE within a view
 CREATE VIEW view13 AS
 SELECT s.key
 FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 5 ON key) s
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/2052853769/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/782478113/10000
 POSTHOOK: Output: default@view13
 PREHOOK: query: DESCRIBE EXTENDED view13
 PREHOOK: type: DESCTABLE
@@ -672,19 +702,19 @@
 POSTHOOK: type: DESCTABLE
 key	int	
 	 	 
-Detailed Table Information	Table(tableName:view13, dbName:default, owner:jsichi, createTime:1263943817, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view13, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943817}, viewOriginalText:SELECT s.key	 
+Detailed Table Information	Table(tableName:view13, dbName:default, owner:jsichi, createTime:1264709944, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:int, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709944}, viewOriginalText:SELECT s.key	 
 FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 5 ON key) s, viewExpandedText:SELECT `s`.`key`	 	 
-FROM `srcbucket` TABLESAMPLE (BUCKET 1 OUT OF 5 ON `key`) `s`)		 
+FROM `srcbucket` TABLESAMPLE (BUCKET 1 OUT OF 5 ON `key`) `s`, tableType:VIRTUAL_VIEW)		 
 PREHOOK: query: SELECT * FROM view13
 ORDER BY key LIMIT 12
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcbucket
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1700324010/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/445413802/10000
 POSTHOOK: query: SELECT * FROM view13
 ORDER BY key LIMIT 12
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@srcbucket
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1700324010/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/445413802/10000
 0
 0
 0
@@ -699,32 +729,32 @@
 15
 PREHOOK: query: -- test usage of JOIN+UNION+AGG all within same view
 CREATE VIEW view14 AS
-SELECT unionsrc1.key as k1, unionsrc1.value as v1, 
+SELECT unionsrc1.key as k1, unionsrc1.value as v1,
        unionsrc2.key as k2, unionsrc2.value as v2
 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
-                         UNION  ALL  
-      select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1 
-JOIN 
+                         UNION  ALL
+      select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1
+JOIN
      (select 'tst1' as key, cast(count(1) as string) as value from src s3
-                         UNION  ALL  
+                         UNION  ALL
       select s4.key as key, s4.value as value from src s4 where s4.key < 10) unionsrc2
 ON (unionsrc1.key = unionsrc2.key)
 PREHOOK: type: CREATEVIEW
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1695885212/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/937833676/10000
 POSTHOOK: query: -- test usage of JOIN+UNION+AGG all within same view
 CREATE VIEW view14 AS
-SELECT unionsrc1.key as k1, unionsrc1.value as v1, 
+SELECT unionsrc1.key as k1, unionsrc1.value as v1,
        unionsrc2.key as k2, unionsrc2.value as v2
 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
-                         UNION  ALL  
-      select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1 
-JOIN 
+                         UNION  ALL
+      select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1
+JOIN
      (select 'tst1' as key, cast(count(1) as string) as value from src s3
-                         UNION  ALL  
+                         UNION  ALL
       select s4.key as key, s4.value as value from src s4 where s4.key < 10) unionsrc2
 ON (unionsrc1.key = unionsrc2.key)
 POSTHOOK: type: CREATEVIEW
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1695885212/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/937833676/10000
 POSTHOOK: Output: default@view14
 PREHOOK: query: DESCRIBE EXTENDED view14
 PREHOOK: type: DESCTABLE
@@ -735,35 +765,35 @@
 k2	string	
 v2	string	
 	 	 
-Detailed Table Information	Table(tableName:view14, dbName:default, owner:jsichi, createTime:1263943824, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:k1, type:string, comment:null), FieldSchema(name:v1, type:string, comment:null), FieldSchema(name:k2, type:string, comment:null), FieldSchema(name:v2, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/view14, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1263943824}, viewOriginalText:SELECT unionsrc1.key as k1, unionsrc1.value as v1, 	 
+Detailed Table Information	Table(tableName:view14, dbName:default, owner:jsichi, createTime:1264709947, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:k1, type:string, comment:null), FieldSchema(name:v1, type:string, comment:null), FieldSchema(name:k2, type:string, comment:null), FieldSchema(name:v2, type:string, comment:null)], location:null, inputFormat:null, outputFormat:null, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1264709947}, viewOriginalText:SELECT unionsrc1.key as k1, unionsrc1.value as v1,	 
        unionsrc2.key as k2, unionsrc2.value as v2	 	 
 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1	 	 
-                         UNION  ALL  	 	 
-      select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1 	 	 
-JOIN 	 	 
+                         UNION  ALL	 	 
+      select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1	 	 
+JOIN	 	 
      (select 'tst1' as key, cast(count(1) as string) as value from src s3	 	 
-                         UNION  ALL  	 	 
+                         UNION  ALL	 	 
       select s4.key as key, s4.value as value from src s4 where s4.key < 10) unionsrc2	 	 
-ON (unionsrc1.key = unionsrc2.key), viewExpandedText:SELECT `unionsrc1`.`key` as `k1`, `unionsrc1`.`value` as `v1`, 	 	 
+ON (unionsrc1.key = unionsrc2.key), viewExpandedText:SELECT `unionsrc1`.`key` as `k1`, `unionsrc1`.`value` as `v1`,	 	 
        `unionsrc2`.`key` as `k2`, `unionsrc2`.`value` as `v2`	 	 
 FROM (select 'tst1' as `key`, cast(count(1) as string) as `value` from `src` `s1`	 	 
-                         UNION  ALL  	 	 
-      select `s2`.`key` as `key`, `s2`.`value` as `value` from `src` `s2` where `s2`.`key` < 10) `unionsrc1` 	 	 
-JOIN 	 	 
+                         UNION  ALL	 	 
+      select `s2`.`key` as `key`, `s2`.`value` as `value` from `src` `s2` where `s2`.`key` < 10) `unionsrc1`	 	 
+JOIN	 	 
      (select 'tst1' as `key`, cast(count(1) as string) as `value` from `src` `s3`	 	 
-                         UNION  ALL  	 	 
+                         UNION  ALL	 	 
       select `s4`.`key` as `key`, `s4`.`value` as `value` from `src` `s4` where `s4`.`key` < 10) `unionsrc2`	 	 
-ON (`unionsrc1`.`key` = `unionsrc2`.`key`))		 
+ON (`unionsrc1`.`key` = `unionsrc2`.`key`), tableType:VIRTUAL_VIEW)		 
 PREHOOK: query: SELECT * FROM view14
 ORDER BY k1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1930214259/10000
+PREHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1988629463/10000
 POSTHOOK: query: SELECT * FROM view14
 ORDER BY k1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/1930214259/10000
+POSTHOOK: Output: file:/data/users/jsichi/open/hive-trunk/build/ql/scratchdir/1988629463/10000
 0	val_0	0	val_0
 0	val_0	0	val_0
 0	val_0	0	val_0

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java?rev=905383&r1=905382&r2=905383&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java (original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java Mon Feb  1 19:30:09 2010
@@ -91,8 +91,8 @@
         .add(org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.class.getName());
   }
 
-  public static boolean isNativeSerDe(String serde) {
-    return nativeSerDeNames.contains(serde);
+  public static boolean shouldGetColsFromSerDe(String serde) {
+    return (serde != null) && !nativeSerDeNames.contains(serde);
   }
 
   private static boolean initCoreSerDes = registerCoreSerDes();



Mime
View raw message