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


##########
web-v2/web/src/lib/utils/index.js:
##########
@@ -186,6 +237,13 @@ export const genUpdates = (originalData, newData, 
disableUpdate = false) => {
           nullable: newColumnsMap[key].nullable
         })
       }
+      if (Boolean(originalColumnsMap[key].autoIncrement) !== 
Boolean(newColumnsMap[key].autoIncrement)) {

Review Comment:
   [P1] Editing a Doris table comment can now submit 
`updateColumnAutoIncrement(false)` for an untouched column. The dialog omits 
this field when the provider has no AutoIncrement control, so omission must 
mean “leave unchanged.” Please generate the update only for an explicitly 
submitted flag and test cached `true` against both an omitted value and an 
explicit `false`.



##########
web-v2/web/src/lib/utils/index.js:
##########
@@ -65,6 +71,50 @@ export const loggerGitHubInfo = (stars, forks) => {
   )
 }
 
+export 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':
+      return {
+        type: 'function',
+        funcName: expression.funcName,
+        funcArgs: (expression.funcArgs ?? []).map(normalizeColumnDefaultValue)
+      }
+
+    case 'unparsed':
+      return {
+        type: 'unparsed',
+        unparsedExpression: expression.unparsedExpression

Review Comment:
   [P2] For an existing unparsed default, the Default Value input appears blank 
and accepts text, but saving discards what the user typed because this branch 
reads only `unparsedExpression`. Please distinguish an untouched expression 
from an explicit replacement, or make expressions the form cannot edit 
read-only. Cover the edit-form path as well as normalization of an untouched 
expression.



##########
web-v2/web/src/app/catalogs/rightContent/entitiesContent/TableDetailsPage.js:
##########
@@ -411,9 +453,21 @@ export default function TableDetailsPage({ ...props }) {
               
metadataObjectFullName={`${catalog}.${schema}.${table}.${record.name}`}
             />
           ) : null
+      },
+      {
+        title: 'Policies',
+        dataIndex: 'policies',
+        key: 'policies',
+        render: (_, record) =>
+          record?.node === 'tableColumn' ? (
+            <Policies
+              metadataObjectType={'column'}
+              
metadataObjectFullName={`${catalog}.${schema}.${table}.${record.name}`}
+            />
+          ) : null
       }
-    ],
-    [store.activatedDetails]
+    ].filter(column => !column.metadataKey || 
visibleMetadataColumns.includes(column.metadataKey)),

Review Comment:
   [P1] Opening the Columns tab with all four settings checked still shows only 
Column Name, Data Type, Tags, and Policies. Please add the four metadata column 
definitions with matching `metadataKey` values and wire the default-value 
renderer into its column. A grid test that reads a value, hides its column, and 
shows it again would catch this.



##########
web-v2/web/src/lib/utils/index.js:
##########
@@ -186,6 +237,13 @@ export const genUpdates = (originalData, newData, 
disableUpdate = false) => {
           nullable: newColumnsMap[key].nullable
         })
       }
+      if (Boolean(originalColumnsMap[key].autoIncrement) !== 
Boolean(newColumnsMap[key].autoIncrement)) {
+        updates.push({
+          '@type': 'updateColumnAutoIncrement',
+          fieldName: [newColumnsMap[key].name],

Review Comment:
   [P2] On MySQL, renaming an auto-increment column and switching AutoIncrement 
off in the same save targets the new name before the connector can look it up. 
Please make the connector account for the pending rename when building the 
ALTER, or prevent that combination in the dialog with guidance to save the 
edits separately. A rename-plus-disable regression case would exercise the 
failing path.



-- 
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