From d7fd71a5c2db9c4e90622761d304e9676be49e32 Mon Sep 17 00:00:00 2001 From: chulanovskyi Date: Tue, 23 Jul 2024 16:07:57 +0300 Subject: [PATCH] fix: map partition keys data properly --- reverse_engineering/helpers/tablePropertiesHelper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reverse_engineering/helpers/tablePropertiesHelper.js b/reverse_engineering/helpers/tablePropertiesHelper.js index e2d9640..b4b1a9d 100644 --- a/reverse_engineering/helpers/tablePropertiesHelper.js +++ b/reverse_engineering/helpers/tablePropertiesHelper.js @@ -77,7 +77,7 @@ 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, @@ -85,7 +85,7 @@ const mapTableData = ({ tableData, _, logger }) => { 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, @@ -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 }), }; };