yuqi1129 opened a new issue, #14687:
URL: https://github.com/apache/gravitino/issues/14687
### Version
main branch
### Describe what's wrong
MySQL Boolean columns map to BIT, but Boolean literal defaults are rendered
as quoted strings (`'true'`/`'false'`) by the generic JDBC default converter.
MySQL rejects these defaults, so normal table creation and ALTER COLUMN SET
DEFAULT fail. BIT(1) defaults returned by MySQL metadata also fall back to
unparsed expressions rather than Boolean literals.
### Error message and/or stacktrace
MySQL reports `Invalid default value` when creating or altering a Boolean
column with a default.
### How to reproduce
Create a table in a `jdbc-mysql` catalog with this column:
```json
{"name":"enabled","type":"boolean","nullable":false,"defaultValue":{"type":"literal","dataType":"boolean","value":"true"}}
```
Repeat with `false`, or update a Boolean column's default through ALTER. The
same column without a default succeeds.
### Additional context
Render Boolean defaults as BIT-compatible numeric 1/0 and reload single-bit
metadata defaults as Boolean literals. Preserve NULL, string, expression and
wider BIT defaults.
--
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]