Skip to content

Commit

Permalink
fix RE with empty table partition keys
Browse files Browse the repository at this point in the history
  • Loading branch information
taras-dubyk committed Jun 1, 2020
1 parent abc7373 commit 294efcb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions reverse_engineering/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ module.exports = {

const mapTableData = ({ Table }, dbDescription) => {
const classification = getClassification(Table.Parameters);
const partitionKeys = Table.PartitionKeys || [];
const tableData = {
dbName: Table.DatabaseName,
collectionName: Table.Name,
Expand All @@ -120,7 +121,7 @@ const mapTableData = ({ Table }, dbDescription) => {
description: Table.Description,
externalTable: Table.TableType === 'EXTERNAL_TABLE',
tableProperties: mapTableProperties(Table.Parameters),
compositePartitionKey: Table.PartitionKeys.map(item => item.Name),
compositePartitionKey: partitionKeys.map(item => item.Name),
compositeClusteringKey: Table.StorageDescriptor.BucketColumns,
sortedByKey: mapSortColumns(Table.StorageDescriptor.SortColumns),
compressed: Table.StorageDescriptor.Compressed,
Expand All @@ -137,7 +138,7 @@ const mapTableData = ({ Table }, dbDescription) => {
},
documents: [],
validation: {
jsonSchema: getColumns([...Table.StorageDescriptor.Columns, ...Table.PartitionKeys])
jsonSchema: getColumns([...Table.StorageDescriptor.Columns, ...partitionKeys])
}
};
return tableData;
Expand Down

0 comments on commit 294efcb

Please sign in to comment.