ayush786hack commented on code in PR #14917:
URL: https://github.com/apache/gravitino/pull/14917#discussion_r4621889994
##########
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:
Fixed in commit 27aa29330. AutoIncrement updates are now generated only when
the field is explicitly provided and its value differs from the original value.
An omitted field is treated as unchanged.
Added regression coverage for a cached AutoIncrement=true column when the
field is omitted during an unrelated comment edit.
##########
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:
Fixed in commit 27aa29330. Existing unparsed default expressions are now
populated into the edit form instead of appearing blank. During normalization,
the user's edited value takes precedence, while the original unparsed
expression is preserved when unchanged.
Added regression tests covering both unchanged and edited unparsed default
expressions.
--
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]