Skip to content

Commit

Permalink
fix: map partition keys data properly (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
chulanovskyi-bs authored Jul 23, 2024
1 parent 186e444 commit 262700f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reverse_engineering/helpers/tablePropertiesHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ const mapColumns = ({ columns = [], logger = {} }) => {
};

const mapTableData = ({ tableData, _, logger }) => {
const partitionKeys = tableData.Table.PartitionKeys || [];
const partitionKeys = mapColumns({ columns: tableData.Table.PartitionKeys, logger });

return {
name: tableData.Table.Name,
entityLevelData: {
description: tableData.Table.Description,
externalTable: tableData.Table.TableType === 'EXTERNAL_TABLE',
tableProperties: mapTableProperties(tableData.Table.Parameters),
compositePartitionKey: partitionKeys.map(item => item.Name),
compositePartitionKey: partitionKeys.map(item => item.name),
compositeClusteringKey: tableData.Table.StorageDescriptor?.BucketColumns,
sortedByKey: mapSortColumns(tableData.Table.StorageDescriptor?.SortColumns),
compressed: tableData.Table.StorageDescriptor?.Compressed,
Expand All @@ -99,7 +99,7 @@ const mapTableData = ({ tableData, _, logger }) => {
serDeParameters: mapSerDeParameters(tableData.Table.StorageDescriptor?.SerdeInfo?.Parameters),
classification: getClassification(tableData.Table.Parameters),
},
partitionKeys: tableData.Table.PartitionKeys || [],
partitionKeys,
columns: mapColumns({ columns: tableData.Table.StorageDescriptor.Columns, logger }),
};
};
Expand Down

0 comments on commit 262700f

Please sign in to comment.