Update Doris

This commit is contained in:
sunkaixuan 2024-03-26 20:57:35 +08:00
parent cba36f5a4b
commit 2114e194cd

View File

@ -21,7 +21,7 @@ namespace SqlSugar
Check.ExceptionEasy(columns.Where(it => it.IsPrimarykey).Count() > 1, "Doris Only one primary key is supported", "Doris只支持单主键");
sql = sql.Replace("$PrimaryKey)", ")");
var pkName = sqlBuilder.GetTranslationColumnName(pk.DbColumnName);
sql += " \r\nENGINE=OLAP\r\nDUPLICATE KEY(" + pkName + ")\r\nDISTRIBUTED BY HASH(" + pkName + ") BUCKETS 1\r\nPROPERTIES (\r\n 'replication_num' = '1',\r\n 'storage_format' = 'DEFAULT'\r\n);\r\n\r\n";
sql += " \r\nENGINE=OLAP\r\nUNIQUE KEY(" + pkName + ")\r\nDISTRIBUTED BY HASH(" + pkName + ") BUCKETS 1\r\nPROPERTIES (\r\n 'replication_num' = '1',\r\n 'storage_format' = 'DEFAULT'\r\n);\r\n\r\n";
}
return sql;
}