yuqi1129 opened a new issue, #13974:
URL: https://github.com/apache/gravitino/issues/13974
### Version
main branch
### Describe what's wrong
Doris and StarRocks write table property keys and values into DDL without
escaping:
- Doris CREATE TABLE escapes them (`DorisUtils.generatePropertiesSql`), but
ALTER TABLE `SetProperty` formats them raw in
`DorisTableOperations.generateTableProperties`.
- StarRocks writes them raw on both CREATE TABLE
(`StarRocksUtils.generatePropertiesSql`, also used for CREATE DATABASE) and
ALTER TABLE (`StarRocksTableOperations.generateTableProperties`).
A property value that contains a double quote produces invalid DDL. A value
carrying quotes and SQL text changes the generated statement itself. StarRocks
only allows altering a fixed set of keys, but any key with the
`dynamic_partition.` or `binlog.` prefix is accepted, so the key is affected
too.
### Error message and/or stacktrace
The database rejects the statement with a syntax error.
### How to reproduce
1. Alter a Doris table with `TableChange.setProperty("k", "a\"b")`.
2. The generated SQL is `set ("k" = "a"b")`, which is invalid.
### Additional context
Doris already escapes the CREATE TABLE path with
`JdbcConnectorUtils.escapeSqlLiteral` and unescapes properties read back from
`SHOW CREATE`. The same approach applies to the other paths.
--
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]