You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2009/08/08 07:40:12 UTC
svn commit: r802300 - in /hadoop/hive/trunk: CHANGES.txt
metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
Author: zshao
Date: Sat Aug 8 05:40:11 2009
New Revision: 802300
URL: http://svn.apache.org/viewvc?rev=802300&view=rev
Log:
HIVE-740. Fix HiveMetaStore get_fields. (Eric Hwang via zshao)
Modified:
hadoop/hive/trunk/CHANGES.txt
hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=802300&r1=802299&r2=802300&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Sat Aug 8 05:40:11 2009
@@ -483,6 +483,8 @@
HIVE-344. Fixes for running Hive under cygwin.
(Amr Awadallah via athusoo)
+ HIVE-740. Fix HiveMetaStore get_fields. (Eric Hwang via zshao)
+
Release 0.3.1 - Unreleased
INCOMPATIBLE CHANGES
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=802300&r1=802299&r2=802300&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 Sat Aug 8 05:40:11 2009
@@ -44,6 +44,7 @@
import org.apache.hadoop.hive.metastore.api.UnknownTableException;
import org.apache.hadoop.hive.serde2.Deserializer;
import org.apache.hadoop.hive.serde2.SerDeException;
+import org.apache.hadoop.hive.serde2.SerDeUtils;
import org.apache.hadoop.util.ReflectionUtils;
import org.apache.hadoop.util.StringUtils;
@@ -640,12 +641,17 @@
} catch (NoSuchObjectException e) {
throw new UnknownTableException(e.getMessage());
}
- try {
- Deserializer s = MetaStoreUtils.getDeserializer(this.hiveConf, tbl);
- return MetaStoreUtils.getFieldsFromDeserializer(tableName, s);
- } catch(SerDeException e) {
- StringUtils.stringifyException(e);
- throw new MetaException(e.getMessage());
+ boolean isNative = SerDeUtils.isNativeSerDe(tbl.getSd().getSerdeInfo().getSerializationLib());
+ if (isNative)
+ return tbl.getSd().getCols();
+ else {
+ try {
+ Deserializer s = MetaStoreUtils.getDeserializer(this.hiveConf, tbl);
+ return MetaStoreUtils.getFieldsFromDeserializer(tableName, s);
+ } catch(SerDeException e) {
+ StringUtils.stringifyException(e);
+ throw new MetaException(e.getMessage());
+ }
}
}