Skip to content

Commit

Permalink
HCK-10222: fix data type property for complex types (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhii-filonenko authored Mar 7, 2025
1 parent 53036d4 commit f1a5f33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions forward_engineering/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,16 @@ const getColumnSchema =
*/
const decorateType = ({ type, columnDefinition }) => {
const deps = { assignTemplates: (__, { name = '', type }) => name + type, tab: value => value, templates: {} };
const dataType = getColumnSchema(deps)({
const fullDataType = getColumnSchema(deps)({
name: '',
type,
dataTypeMode: columnDefinition.dataTypeMode,
jsonSchema: columnDefinition,
});
const dataType = fullDataType.trim();
const isComplexType = /^(array|struct)/i.test(dataType);

return dataType.trim();
return isComplexType ? dataType.replace(/<[\s\S]+>$/, '<>') : dataType;
};

const generateViewSelectStatement =
Expand Down

0 comments on commit f1a5f33

Please sign in to comment.