Commit 812ee5ba by Shwetha GS

re-using getColumns() for partition keys

parent 40e0d41e
...@@ -277,20 +277,8 @@ public class HiveMetaStoreBridge { ...@@ -277,20 +277,8 @@ public class HiveMetaStoreBridge {
tableRef.set("sd", sdReferenceable); tableRef.set("sd", sdReferenceable);
// add reference to the Partition Keys // add reference to the Partition Keys
List<Referenceable> partKeys = new ArrayList<>(); List<Referenceable> partKeys = getColumns(hiveTable.getPartitionKeys());;
Referenceable colRef;
if (hiveTable.getPartitionKeys().size() > 0) {
for (FieldSchema fs : hiveTable.getPartitionKeys()) {
colRef = new Referenceable(HiveDataTypes.HIVE_COLUMN.getName());
colRef.set("name", fs.getName());
colRef.set("type", fs.getType());
colRef.set("comment", fs.getComment());
Referenceable colRefTyped = createInstance(colRef);
partKeys.add(colRefTyped);
}
tableRef.set("partitionKeys", partKeys); tableRef.set("partitionKeys", partKeys);
}
tableRef.set("parameters", hiveTable.getParameters()); tableRef.set("parameters", hiveTable.getParameters());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment