Fix regression caused by DRILL-521

DRILL-521 moved to metastore.api.Table from ql.metadata.Table which caused
failures when reading Hive tables that have schema given in SerDe properties
such as avro. Revert to using ql.metadata.Table.


Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/fcd5988d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/fcd5988d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/fcd5988d

Branch: refs/heads/master
Commit: fcd5988de7edcb1d2b72377b1637e7c7b88a3d77
Parents: 21d9fb7
Author: vkorukanti <[email protected]>
Authored: Wed Jun 11 23:05:52 2014 -0700
Committer: vkorukanti <[email protected]>
Committed: Wed Jun 11 23:05:52 2014 -0700

----------------------------------------------------------------------
 .../apache/drill/exec/store/hive/schema/DrillHiveTable.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/fcd5988d/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
index 547c0bb..949fa06 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
@@ -26,7 +26,7 @@ import org.apache.drill.exec.planner.logical.DrillTable;
 import org.apache.drill.exec.store.hive.HiveReadEntry;
 import org.apache.drill.exec.store.hive.HiveStoragePlugin;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
-import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.hive.ql.metadata.Table;
 import org.apache.hadoop.hive.serde2.typeinfo.ListTypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.MapTypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
@@ -45,7 +45,7 @@ public class DrillHiveTable extends DrillTable{
   
   public DrillHiveTable(String storageEngineName, HiveStoragePlugin plugin, 
HiveReadEntry readEntry) {
     super(storageEngineName, plugin, readEntry);
-    this.hiveTable = readEntry.getTable();
+    this.hiveTable = new Table(readEntry.getTable());
   }
 
   @Override
@@ -53,7 +53,7 @@ public class DrillHiveTable extends DrillTable{
     List<RelDataType> typeList = Lists.newArrayList();
     List<String> fieldNameList = Lists.newArrayList();
 
-    List<FieldSchema> hiveFields = hiveTable.getSd().getCols();
+    List<FieldSchema> hiveFields = hiveTable.getCols();
     for(FieldSchema hiveField : hiveFields) {
       fieldNameList.add(hiveField.getName());
       typeList.add(getNullableRelDataTypeFromHiveType(

Reply via email to