[feature](compaction) allow to set disable_auto_compaction for tables (#11743)

This commit is contained in:
Gabriel
2022-08-17 11:05:47 +08:00
committed by GitHub
parent 12c4d1f4dd
commit ba3e0b3f96
21 changed files with 161 additions and 34 deletions

View File

@ -245,7 +245,8 @@ public class RollupJobV2 extends AlterJobV2 implements GsonPostProcessable {
tabletType,
null,
tbl.getCompressionType(),
tbl.getEnableUniqueKeyMergeOnWrite(), tbl.getStoragePolicy());
tbl.getEnableUniqueKeyMergeOnWrite(), tbl.getStoragePolicy(),
tbl.disableAutoCompaction());
createReplicaTask.setBaseTablet(tabletIdMap.get(rollupTabletId), baseSchemaHash);
if (this.storageFormat != null) {
createReplicaTask.setStorageFormat(this.storageFormat);

View File

@ -265,7 +265,8 @@ public class SchemaChangeJobV2 extends AlterJobV2 {
tbl.getPartitionInfo().getTabletType(partitionId),
null,
tbl.getCompressionType(),
tbl.getEnableUniqueKeyMergeOnWrite(), tbl.getStoragePolicy());
tbl.getEnableUniqueKeyMergeOnWrite(), tbl.getStoragePolicy(),
tbl.disableAutoCompaction());
createReplicaTask.setBaseTablet(partitionIndexTabletMap.get(partitionId, shadowIdxId)
.get(shadowTabletId), originSchemaHash);

View File

@ -970,7 +970,8 @@ public class RestoreJob extends AbstractJob {
localTbl.getPartitionInfo().getTabletType(restorePart.getId()),
null,
localTbl.getCompressionType(),
localTbl.getEnableUniqueKeyMergeOnWrite(), localTbl.getStoragePolicy());
localTbl.getEnableUniqueKeyMergeOnWrite(), localTbl.getStoragePolicy(),
localTbl.disableAutoCompaction());
task.setInRestoreMode(true);
batchTask.addTask(task);

View File

@ -2915,6 +2915,10 @@ public class Env {
sb.append(olapTable.getSequenceType().toString()).append("\"");
}
// disable auto compaction
sb.append(",\n\"").append(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION).append("\" = \"");
sb.append(olapTable.disableAutoCompaction()).append("\"");
sb.append("\n)");
} else if (table.getType() == TableType.MYSQL) {
MysqlTable mysqlTable = (MysqlTable) table;

View File

@ -1582,6 +1582,22 @@ public class OlapTable extends Table {
return "";
}
public void setDisableAutoCompaction(boolean disableAutoCompaction) {
if (tableProperty == null) {
tableProperty = new TableProperty(new HashMap<>());
}
tableProperty.modifyTableProperties(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION,
Boolean.valueOf(disableAutoCompaction).toString());
tableProperty.buildDisableAutoCompaction();
}
public Boolean disableAutoCompaction() {
if (tableProperty != null) {
return tableProperty.disableAutoCompaction();
}
return false;
}
public void setDataSortInfo(DataSortInfo dataSortInfo) {
if (tableProperty == null) {
tableProperty = new TableProperty(new HashMap<>());

View File

@ -75,6 +75,8 @@ public class TableProperty implements Writable {
private boolean enableLightSchemaChange = false;
private Boolean disableAutoCompaction;
private DataSortInfo dataSortInfo = new DataSortInfo();
// remote storage policy, for cold data
@ -152,6 +154,16 @@ public class TableProperty implements Writable {
return this;
}
public TableProperty buildDisableAutoCompaction() {
disableAutoCompaction = Boolean.parseBoolean(
properties.getOrDefault(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION, "false"));
return this;
}
public boolean disableAutoCompaction() {
return disableAutoCompaction;
}
public TableProperty buildStoragePolicy() {
storagePolicy = properties.getOrDefault(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY, "");
return this;

View File

@ -114,6 +114,8 @@ public class PropertyAnalyzer {
public static final String PROPERTIES_STORAGE_POLICY = "storage_policy";
public static final String PROPERTIES_DISABLE_AUTO_COMPACTION = "disable_auto_compaction";
private static final Logger LOG = LogManager.getLogger(PropertyAnalyzer.class);
private static final String COMMA_SEPARATOR = ",";
private static final double MAX_FPP = 0.05;
@ -472,6 +474,25 @@ public class PropertyAnalyzer {
+ " must be `true` or `false`");
}
public static Boolean analyzeDisableAutoCompaction(Map<String, String> properties) throws AnalysisException {
if (properties == null || properties.isEmpty()) {
return false;
}
String value = properties.get(PROPERTIES_DISABLE_AUTO_COMPACTION);
// set light schema change false by default
if (null == value) {
return false;
}
properties.remove(PROPERTIES_DISABLE_AUTO_COMPACTION);
if (value.equalsIgnoreCase("true")) {
return true;
} else if (value.equalsIgnoreCase("false")) {
return false;
}
throw new AnalysisException(PROPERTIES_DISABLE_AUTO_COMPACTION
+ " must be `true` or `false`");
}
// analyzeCompressionType will parse the compression type from properties
public static TCompressionType analyzeCompressionType(Map<String, String> properties) throws AnalysisException {
String compressionType = "";

View File

@ -1247,6 +1247,10 @@ public class InternalCatalog implements CatalogIf<Database> {
if (!properties.containsKey(PropertyAnalyzer.PROPERTIES_INMEMORY)) {
properties.put(PropertyAnalyzer.PROPERTIES_INMEMORY, olapTable.isInMemory().toString());
}
if (!properties.containsKey(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION)) {
properties.put(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION,
olapTable.disableAutoCompaction().toString());
}
singlePartitionDesc.analyze(partitionInfo.getPartitionColumns().size(), properties);
partitionInfo.createAndCheckPartitionItem(singlePartitionDesc, isTempPartition);
@ -1325,7 +1329,8 @@ public class InternalCatalog implements CatalogIf<Database> {
singlePartitionDesc.getVersionInfo(), bfColumns, olapTable.getBfFpp(), tabletIdSet,
olapTable.getCopiedIndexes(), singlePartitionDesc.isInMemory(), olapTable.getStorageFormat(),
singlePartitionDesc.getTabletType(), olapTable.getCompressionType(), olapTable.getDataSortInfo(),
olapTable.getEnableUniqueKeyMergeOnWrite(), olapTable.getStoragePolicy(), idGeneratorBuffer);
olapTable.getEnableUniqueKeyMergeOnWrite(), olapTable.getStoragePolicy(), idGeneratorBuffer,
olapTable.disableAutoCompaction());
// check again
table = db.getOlapTableOrDdlException(tableName);
@ -1547,7 +1552,7 @@ public class InternalCatalog implements CatalogIf<Database> {
Long versionInfo, Set<String> bfColumns, double bfFpp, Set<Long> tabletIdSet, List<Index> indexes,
boolean isInMemory, TStorageFormat storageFormat, TTabletType tabletType, TCompressionType compressionType,
DataSortInfo dataSortInfo, boolean enableUniqueKeyMergeOnWrite, String storagePolicy,
IdGeneratorBuffer idGeneratorBuffer) throws DdlException {
IdGeneratorBuffer idGeneratorBuffer, boolean disableAutoCompaction) throws DdlException {
// create base index first.
Preconditions.checkArgument(baseIndexId != -1);
MaterializedIndex baseIndex = new MaterializedIndex(baseIndexId, IndexState.NORMAL);
@ -1607,7 +1612,8 @@ public class InternalCatalog implements CatalogIf<Database> {
CreateReplicaTask task = new CreateReplicaTask(backendId, dbId, tableId, partitionId, indexId,
tabletId, replicaId, shortKeyColumnCount, schemaHash, version, keysType, storageType,
storageMedium, schema, bfColumns, bfFpp, countDownLatch, indexes, isInMemory, tabletType,
dataSortInfo, compressionType, enableUniqueKeyMergeOnWrite, storagePolicy);
dataSortInfo, compressionType, enableUniqueKeyMergeOnWrite, storagePolicy,
disableAutoCompaction);
task.setStorageFormat(storageFormat);
batchTask.addTask(task);
@ -1736,6 +1742,15 @@ public class InternalCatalog implements CatalogIf<Database> {
// use light schema change optimization
olapTable.setEnableLightSchemaChange(enableLightSchemaChange);
boolean disableAutoCompaction = false;
try {
disableAutoCompaction = PropertyAnalyzer.analyzeDisableAutoCompaction(properties);
} catch (AnalysisException e) {
throw new DdlException(e.getMessage());
}
// use light schema change optimization
olapTable.setDisableAutoCompaction(disableAutoCompaction);
// get storage format
TStorageFormat storageFormat = TStorageFormat.V2; // default is segment v2
try {
@ -1950,7 +1965,7 @@ public class InternalCatalog implements CatalogIf<Database> {
partitionInfo.getReplicaAllocation(partitionId), versionInfo, bfColumns, bfFpp, tabletIdSet,
olapTable.getCopiedIndexes(), isInMemory, storageFormat, tabletType, compressionType,
olapTable.getDataSortInfo(), olapTable.getEnableUniqueKeyMergeOnWrite(), storagePolicy,
idGeneratorBuffer);
idGeneratorBuffer, olapTable.disableAutoCompaction());
olapTable.addPartition(partition);
} else if (partitionInfo.getType() == PartitionType.RANGE
|| partitionInfo.getType() == PartitionType.LIST) {
@ -2008,7 +2023,7 @@ public class InternalCatalog implements CatalogIf<Database> {
tabletIdSet, olapTable.getCopiedIndexes(), isInMemory, storageFormat,
partitionInfo.getTabletType(entry.getValue()), compressionType,
olapTable.getDataSortInfo(), olapTable.getEnableUniqueKeyMergeOnWrite(), storagePolicy,
idGeneratorBuffer);
idGeneratorBuffer, olapTable.disableAutoCompaction());
olapTable.addPartition(partition);
}
} else {
@ -2385,7 +2400,7 @@ public class InternalCatalog implements CatalogIf<Database> {
copiedTbl.isInMemory(), copiedTbl.getStorageFormat(),
copiedTbl.getPartitionInfo().getTabletType(oldPartitionId), copiedTbl.getCompressionType(),
copiedTbl.getDataSortInfo(), copiedTbl.getEnableUniqueKeyMergeOnWrite(),
olapTable.getStoragePolicy(), idGeneratorBuffer);
olapTable.getStoragePolicy(), idGeneratorBuffer, olapTable.disableAutoCompaction());
newPartitions.add(newPartition);
}
} catch (DdlException e) {

View File

@ -607,7 +607,8 @@ public class ReportHandler extends Daemon {
olapTable.getPartitionInfo().getTabletType(partitionId),
null,
olapTable.getCompressionType(),
olapTable.getEnableUniqueKeyMergeOnWrite(), olapTable.getStoragePolicy());
olapTable.getEnableUniqueKeyMergeOnWrite(), olapTable.getStoragePolicy(),
olapTable.disableAutoCompaction());
createReplicaTask.setIsRecoverTask(true);
createReplicaBatchTask.addTask(createReplicaTask);

View File

@ -92,6 +92,8 @@ public class CreateReplicaTask extends AgentTask {
private boolean enableUniqueKeyMergeOnWrite;
private boolean disableAutoCompaction;
public CreateReplicaTask(long backendId, long dbId, long tableId, long partitionId, long indexId, long tabletId,
long replicaId, short shortKeyColumnCount, int schemaHash, long version,
KeysType keysType, TStorageType storageType,
@ -103,7 +105,7 @@ public class CreateReplicaTask extends AgentTask {
DataSortInfo dataSortInfo,
TCompressionType compressionType,
boolean enableUniqueKeyMergeOnWrite,
String storagePolicy) {
String storagePolicy, boolean disableAutoCompaction) {
super(null, backendId, TTaskType.CREATE, dbId, tableId, partitionId, indexId, tabletId);
this.replicaId = replicaId;
@ -130,6 +132,7 @@ public class CreateReplicaTask extends AgentTask {
this.dataSortInfo = dataSortInfo;
this.enableUniqueKeyMergeOnWrite = (keysType == KeysType.UNIQUE_KEYS && enableUniqueKeyMergeOnWrite);
this.storagePolicy = storagePolicy;
this.disableAutoCompaction = disableAutoCompaction;
}
public void setIsRecoverTask(boolean isRecoverTask) {
@ -228,6 +231,7 @@ public class CreateReplicaTask extends AgentTask {
tSchema.setBloomFilterFpp(bfFpp);
}
tSchema.setIsInMemory(isInMemory);
tSchema.setDisableAutoCompaction(disableAutoCompaction);
createTabletReq.setTabletSchema(tSchema);
createTabletReq.setVersion(version);

View File

@ -40,7 +40,7 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ ") ENGINE = OLAP unique KEY(`userId`)\n" + "COMMENT 'varchar_table'\n"
+ "DISTRIBUTED BY HASH(`userId`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")";
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")";
createTable(varcharTable);
String decimalTable = "CREATE TABLE `test`.`decimal_table`\n" + "(\n"
+ " `userId` varchar(255) NOT NULL,\n" + " `amount_decimal` decimal(10, 2) NOT NULL\n"
@ -67,7 +67,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ "AGGREGATE KEY(`userId`)\n" + "COMMENT 'OLAP'\n"
+ "DISTRIBUTED BY HASH(`userId`) BUCKETS 10\n"
+ "PROPERTIES (\n" + "\"replication_allocation\" = \"tag.location.default: 1\",\n"
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\"\n" + ")",
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\","
+ "\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showCreateTableByName("select_decimal_table").getResultRows().get(0).get(1));
String selectFromDecimal1 =
"create table `test`.`select_decimal_table_1` PROPERTIES(\"replication_num\" = \"1\") "
@ -78,14 +79,16 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
"CREATE TABLE `select_decimal_table_1` (\n" + " `_col0` decimal(38, 2) NULL\n" + ") ENGINE=OLAP\n"
+ "DUPLICATE KEY(`_col0`)\n" + "COMMENT 'OLAP'\n" + "DISTRIBUTED BY HASH(`_col0`) BUCKETS 10\n"
+ "PROPERTIES (\n" + "\"replication_allocation\" = \"tag.location.default: 1\",\n"
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\"\n" + ")",
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\","
+ "\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showCreateTableByName("select_decimal_table_1").getResultRows().get(0).get(1));
} else {
Assertions.assertEquals(
"CREATE TABLE `select_decimal_table_1` (\n" + " `_col0` decimal(27, 9) NULL\n" + ") ENGINE=OLAP\n"
+ "DUPLICATE KEY(`_col0`)\n" + "COMMENT 'OLAP'\n" + "DISTRIBUTED BY HASH(`_col0`) BUCKETS 10\n"
+ "PROPERTIES (\n" + "\"replication_allocation\" = \"tag.location.default: 1\",\n"
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\"\n" + ")",
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\","
+ "\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showCreateTableByName("select_decimal_table_1").getResultRows().get(0).get(1));
}
}
@ -110,7 +113,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ " `username` varchar(255) REPLACE NOT NULL\n" + ") ENGINE=OLAP\n" + "AGGREGATE KEY(`userId`)\n"
+ "COMMENT 'OLAP'\n" + "DISTRIBUTED BY HASH(`userId`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")", showResultSet.getResultRows().get(0).get(1));
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet.getResultRows().get(0).get(1));
}
@Test
@ -123,7 +127,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
"CREATE TABLE `select_function_1` (\n" + " `_col0` bigint(20) NULL\n" + ") ENGINE=OLAP\n"
+ "DUPLICATE KEY(`_col0`)\n" + "COMMENT 'OLAP'\n" + "DISTRIBUTED BY HASH(`_col0`) BUCKETS 10\n"
+ "PROPERTIES (\n" + "\"replication_allocation\" = \"tag.location.default: 1\",\n"
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\"\n" + ")",
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\""
+ ",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet1.getResultRows().get(0).get(1));
String selectFromFunction2 = "create table `test`.`select_function_2` PROPERTIES(\"replication_num\" = \"1\") "
@ -138,7 +143,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ "DUPLICATE KEY(`_col0`, `_col1`, `_col2`)\n" + "COMMENT 'OLAP'\n"
+ "DISTRIBUTED BY HASH(`_col0`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")", showResultSet2.getResultRows().get(0).get(1));
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet2.getResultRows().get(0).get(1));
}
@Test
@ -151,7 +157,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ "DUPLICATE KEY(`amount`)\n" + "COMMENT 'OLAP'\n"
+ "DISTRIBUTED BY HASH(`amount`) BUCKETS 10\n"
+ "PROPERTIES (\n" + "\"replication_allocation\" = \"tag.location.default: 1\",\n"
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\"\n" + ")",
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\","
+ "\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet1.getResultRows().get(0).get(1));
String selectAlias2 = "create table `test`.`select_alias_2` PROPERTIES(\"replication_num\" = \"1\") "
+ "as select userId as alias_name, username from `test`.`varchar_table`";
@ -161,7 +168,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ " `username` varchar(255) REPLACE NOT NULL\n" + ") ENGINE=OLAP\n" + "AGGREGATE KEY(`alias_name`)\n"
+ "COMMENT 'OLAP'\n" + "DISTRIBUTED BY HASH(`alias_name`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")", showResultSet2.getResultRows().get(0).get(1));
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet2.getResultRows().get(0).get(1));
}
@Test
@ -176,7 +184,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ ") ENGINE=OLAP\n" + "AGGREGATE KEY(`userId`)\n" + "COMMENT 'OLAP'\n"
+ "DISTRIBUTED BY HASH(`userId`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")", showResultSet.getResultRows().get(0).get(1));
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet.getResultRows().get(0).get(1));
String selectFromJoin1 = "create table `test`.`select_join1` PROPERTIES(\"replication_num\" = \"1\") "
+ "as select vt.userId as userId1, jt.userId as userId2, vt.username, jt.status "
+ "from `test`.`varchar_table` vt " + "join `test`.`join_table` jt on vt.userId=jt.userId";
@ -187,7 +196,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ " `status` int(11) REPLACE NOT NULL\n" + ") ENGINE=OLAP\n" + "AGGREGATE KEY(`userId1`, `userId2`)\n"
+ "COMMENT 'OLAP'\n" + "DISTRIBUTED BY HASH(`userId1`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")", showResultSet1.getResultRows().get(0).get(1));
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet1.getResultRows().get(0).get(1));
}
@Test
@ -203,7 +213,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ ") ENGINE=OLAP\n" + "AGGREGATE KEY(`user`)\n" + "COMMENT 'OLAP'\n"
+ "DISTRIBUTED BY HASH(`user`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")", showResultSet.getResultRows().get(0).get(1));
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet.getResultRows().get(0).get(1));
}
@Test
@ -216,7 +227,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ "DUPLICATE KEY(`userId`)\n" + "COMMENT 'OLAP'\n"
+ "DISTRIBUTED BY HASH(`userId`) BUCKETS 10\n"
+ "PROPERTIES (\n" + "\"replication_allocation\" = \"tag.location.default: 1\",\n"
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\"\n" + ")",
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\""
+ " = \"false\"\n" + ")",
showResultSet.getResultRows().get(0).get(1));
}
@ -231,7 +243,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ "DUPLICATE KEY(`userId`)\n" + "COMMENT 'OLAP'\n"
+ "DISTRIBUTED BY HASH(`userId`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")", showResultSet.getResultRows().get(0).get(1));
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet.getResultRows().get(0).get(1));
String selectFromCteAndUnion = "create table `test`.`select_cte_union` PROPERTIES(\"replication_num\" = \"1\")"
+ "as with source_data as (select 1 as id union all select 2 as id) select * from source_data;";
createTableAsSelect(selectFromCteAndUnion);
@ -240,7 +253,8 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
"CREATE TABLE `select_cte_union` (\n" + " `id` tinyint(4) NULL\n" + ") ENGINE=OLAP\n"
+ "DUPLICATE KEY(`id`)\n" + "COMMENT 'OLAP'\n" + "DISTRIBUTED BY HASH(`id`) BUCKETS 10\n"
+ "PROPERTIES (\n" + "\"replication_allocation\" = \"tag.location.default: 1\",\n"
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\"\n" + ")",
+ "\"in_memory\" = \"false\",\n" + "\"storage_format\" = \"V2\","
+ "\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet1.getResultRows().get(0).get(1));
}
@ -257,6 +271,7 @@ public class CreateTableAsSelectStmtTest extends TestWithFeService {
+ "(PARTITION p1 VALUES IN (\"CA\",\"GB\",\"US\",\"ZH\"))\n"
+ "DISTRIBUTED BY HASH(`userId`) BUCKETS 10\n" + "PROPERTIES (\n"
+ "\"replication_allocation\" = \"tag.location.default: 1\",\n" + "\"in_memory\" = \"false\",\n"
+ "\"storage_format\" = \"V2\"\n" + ")", showResultSet.getResultRows().get(0).get(1));
+ "\"storage_format\" = \"V2\",\n\"disable_auto_compaction\" = \"false\"\n" + ")",
showResultSet.getResultRows().get(0).get(1));
}
}

View File

@ -105,11 +105,9 @@ public class AgentTaskTest {
// create
createReplicaTask = new CreateReplicaTask(backendId1, dbId, tableId, partitionId,
indexId1, tabletId1, replicaId1, shortKeyNum, schemaHash1,
version, KeysType.AGG_KEYS,
storageType, TStorageMedium.SSD,
columns, null, 0, latch, null,
false, TTabletType.TABLET_TYPE_DISK, null, TCompressionType.LZ4F, false, "");
indexId1, tabletId1, replicaId1, shortKeyNum, schemaHash1, version, KeysType.AGG_KEYS, storageType,
TStorageMedium.SSD, columns, null, 0, latch, null, false, TTabletType.TABLET_TYPE_DISK, null,
TCompressionType.LZ4F, false, "", false);
// drop
dropTask = new DropReplicaTask(backendId1, tabletId1, replicaId1, schemaHash1, false);