yuqi1129 commented on code in PR #10318:
URL: https://github.com/apache/gravitino/pull/10318#discussion_r2965942532
##########
catalogs-contrib/catalog-jdbc-clickhouse/src/main/java/org/apache/gravitino/catalog/clickhouse/converter/ClickHouseColumnDefaultValueConverter.java:
##########
@@ -57,10 +58,19 @@ public String fromGravitino(Expression defaultValue) {
return literal.value().toString();
} else {
Object value = literal.value();
+ Preconditions.checkArgument(
+ value != null, "Null default literal value is not supported for
ClickHouse.");
if (value instanceof LocalDateTime) {
value = ((LocalDateTime) value).format(DATE_TIME_FORMATTER);
+ } else if (value instanceof String str
+ && str.length() >= 2
+ && str.startsWith("'")
+ && str.endsWith("'")) {
+ // The API caller may pass quoted string literals (e.g. "'active'"),
but DDL generation
+ // is responsible for adding the outer quotes.
Review Comment:
> if the value = "'active'", that means the const value is "'active'", right?
The value should be `'active'`.
> should pass to '''a''' to the DDL
What do you mean here?
--
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]