Copilot commented on code in PR #12217:
URL: https://github.com/apache/gravitino/pull/12217#discussion_r3656363390
##########
web-v2/web/src/components/ColumnTypeComponent.js:
##########
@@ -123,6 +129,23 @@ export default function ColumnTypeComponent({ ...props }) {
setErrorMsg(errors.join(', '))
}
}
+ if (ColumnWithPrecisionType.includes(value)) {
+ const resolvedPrecision = paramPrecision || currentTypeParam
+ if (currentTypeParam && !paramPrecision) {
+ setParamPrecision(currentTypeParam)
+ }
+ if (resolvedPrecision) {
Review Comment:
Precision value 0 is treated as falsy here, so users cannot set
time/timestamp precision to 0 (it will fall back to currentTypeParam or remove
the parentheses). Use an explicit empty-string check instead of `||`/falsy
checks so `0` remains a valid precision.
##########
web-v2/web/src/app/catalogs/rightContent/CreateTableDialog.js:
##########
@@ -650,7 +650,7 @@ export default function CreateTableDialog({ ...props }) {
column['defaultValue'] = {
type: 'literal',
dataType: col.defaultValue?.dataType || 'string',
- value: col.defaultValue?.value
+ value: col.defaultValue?.value || 'NULL'
Review Comment:
Using `|| 'NULL'` will also convert valid falsy literal default values
(e.g., 0, false) into the string 'NULL'. Only coerce to 'NULL' when the literal
value is actually empty string, null, or undefined.
--
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]