Skip to content

Commit

Permalink
HCK-5436 fix table RE with missed SerDe props (#33)
Browse files Browse the repository at this point in the history
* fix handling missed table properties

* bump aws-sdk version
  • Loading branch information
taras-dubyk authored Apr 22, 2024
1 parent 8994ee0 commit fefc458
Show file tree
Hide file tree
Showing 1,986 changed files with 1,392,697 additions and 237,514 deletions.
26 changes: 13 additions & 13 deletions reverse_engineering/helpers/tablePropertiesHelper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const mapSortColumns = (items) => {
const mapSortColumns = (items = []) => {
return items.map(item => ({
name: item.Column,
type: item.SortOrder === 1 ? 'ascending' : 'descending'
Expand Down Expand Up @@ -55,7 +55,7 @@ const mapTableProperties = (parameters = {}) => {
}, []);
}

const getNumBuckets = (numBuckets) => {
const getNumBuckets = (numBuckets = 0) => {
return numBuckets < 1 ? undefined : numBuckets;
}

Expand All @@ -69,17 +69,17 @@ const mapTableData = (tableData, _) => {
externalTable: tableData.Table.TableType === 'EXTERNAL_TABLE',
tableProperties: mapTableProperties(tableData.Table.Parameters),
compositePartitionKey: partitionKeys.map(item => item.Name),
compositeClusteringKey: tableData.Table.StorageDescriptor.BucketColumns,
sortedByKey: mapSortColumns(tableData.Table.StorageDescriptor.SortColumns),
compressed: tableData.Table.StorageDescriptor.Compressed,
location: tableData.Table.StorageDescriptor.Location,
numBuckets: getNumBuckets(tableData.Table.StorageDescriptor.NumberOfBuckets),
StoredAsSubDirectories: tableData.Table.StorageDescriptor.StoredAsSubDirectories,
inputFormatClassname: tableData.Table.StorageDescriptor.InputFormat,
outputFormatClassname: tableData.Table.StorageDescriptor.OutputFormat,
serDeLibrary: getSerDeLibrary(tableData.Table.StorageDescriptor.SerdeInfo),
parameterPaths: mapSerDePaths(_, tableData.Table.StorageDescriptor.SerdeInfo),
serDeParameters: mapSerDeParameters(tableData.Table.StorageDescriptor.SerdeInfo.Parameters),
compositeClusteringKey: tableData.Table.StorageDescriptor?.BucketColumns,
sortedByKey: mapSortColumns(tableData.Table.StorageDescriptor?.SortColumns),
compressed: tableData.Table.StorageDescriptor?.Compressed,
location: tableData.Table.StorageDescriptor?.Location,
numBuckets: getNumBuckets(tableData.Table.StorageDescriptor?.NumberOfBuckets),
StoredAsSubDirectories: tableData.Table.StorageDescriptor?.StoredAsSubDirectories,
inputFormatClassname: tableData.Table.StorageDescriptor?.InputFormat,
outputFormatClassname: tableData.Table.StorageDescriptor?.OutputFormat,
serDeLibrary: getSerDeLibrary(tableData.Table.StorageDescriptor?.SerdeInfo),
parameterPaths: mapSerDePaths(_, tableData.Table.StorageDescriptor?.SerdeInfo),
serDeParameters: mapSerDeParameters(tableData.Table.StorageDescriptor?.SerdeInfo?.Parameters),
classification: getClassification(tableData.Table.Parameters),
},
partitionKeys: tableData.Table.PartitionKeys || [],
Expand Down
2 changes: 1 addition & 1 deletion reverse_engineering/node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fefc458

Please sign in to comment.