hqbhoho commented on PR #7852:
URL: https://github.com/apache/gravitino/pull/7852#issuecomment-3162227272
> @diqiu50 In current version, I will warp with `UnparseExpression` like
this
>
> ```
> int_col_2 integer WITH ( default = 'UnparsedExpression(rand())' )
> ```
>
> So it is better to support `SHOW CREATE TABLE` and `CREATE TABLE` only for
constant default values, even if it differs from the actual definition in
MySQL, we can document this limitation.
>
> Another question, if default value is null,`SHOW CREATE TABLE` whether to
display null value like this
>
> ```
> int_col_2 integer WITH ( default = 'NULL' )
> ```
>
> I think this is bloated code.
>
> Only for constant default values maybe like this:
>
> ```
> # MySQL create table
> col_int int default (rand()),
> col_tinyint TINYINT DEFAULT 0,
> col_smallint SMALLINT DEFAULT NULL,
>
> # Trino show table
> col_int int,
> col_tinyint tinyint WITH ( default = '0' ),
> col_smallint smallint,
> ```
>
> Boolean-type constants, May need server support, I will check and file a
PR later.
@yuqi1129 Is the above solution reasonable?
Boolean value will be resloved by passing a defaule value like
`Literals.of(1, BooleanType.get())`
--
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]