ayush786hack commented on code in PR #14917:
URL: https://github.com/apache/gravitino/pull/14917#discussion_r4562473030


##########
web-v2/web/src/app/catalogs/rightContent/CreateTableDialog.js:
##########
@@ -76,6 +76,53 @@ import { useAppDispatch } from '@/lib/hooks/useStore'
 const { Paragraph } = Typography
 const { TextArea } = Input
 
+const normalizeColumnDefaultValue = expression => {
+  if (!expression || typeof expression !== 'object') return expression
+
+  switch (expression.type) {
+    case 'literal':
+      return {
+        type: 'literal',
+        dataType: expression.dataType || 'string',
+        value: expression.value
+      }
+
+    case 'field': {
+      const fieldName = expression.fieldName
+
+      return {
+        type: 'field',
+        fieldName: Array.isArray(fieldName) ? fieldName : [fieldName]
+      }
+    }
+
+    case 'function': {
+      const functionArgs = expression.functionArgs || expression.funcArgs || []
+
+      return {
+        type: 'function',
+        functionName: expression.functionName || expression.funcName,
+        functionArgs: functionArgs.map(normalizeColumnDefaultValue)

Review Comment:
   Fixed in commit `a2089e305`. The default-value normalizer now preserves the 
REST property names `funcName` and `funcArgs`, including recursively normalized 
nested function arguments. I also added regression coverage for nested 
REST-format function defaults to ensure unchanged expressions do not generate 
unnecessary updates.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to