Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ namespace config {

// config for default rowset type
// Valid configs: ALPHA, BETA
CONF_String(default_rowset_type, "ALPHA");
CONF_String(default_rowset_type, "BETA");

// Maximum size of a single message body in all protocols
CONF_Int64(brpc_max_body_size, "209715200");
Expand Down
8 changes: 8 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -1293,4 +1293,12 @@ public class Config extends ConfigBase {
*/
@ConfField
public static String http_api_extra_base_path = "";

/**
* Whether to support the creation of alpha rowset tables.
* The default is false and should only be used in emergency situations,
* this config should be remove in some future version
*/
@ConfField
public static boolean enable_alpha_rowset = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ public static TStorageFormat analyzeStorageFormat(Map<String, String> properties
}

if (storageFormat.equalsIgnoreCase("v1")) {
if (!Config.enable_alpha_rowset) {
throw new AnalysisException("Storage format V1 has been deprecated since version 0.14," +
" please use V2 instead");
}
return TStorageFormat.V1;
} else if (storageFormat.equalsIgnoreCase("v2")) {
return TStorageFormat.V2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.doris.catalog.Catalog;
import org.apache.doris.catalog.Database;
import org.apache.doris.catalog.OlapTable;
import org.apache.doris.common.Config;
import org.apache.doris.common.DdlException;
import org.apache.doris.common.FeConstants;
import org.apache.doris.qe.ConnectContext;
Expand Down Expand Up @@ -53,6 +54,7 @@ public static void beforeClass() throws Exception {
FeConstants.runningUnitTest = true;

UtFrameUtils.createMinDorisCluster(runningDir);
Config.enable_alpha_rowset = true;

// create connect context
connectContext = UtFrameUtils.createDefaultCtx();
Expand Down Expand Up @@ -128,7 +130,9 @@ public void testRollup() throws Exception {
}

@Test
@Deprecated
public void testAlterSegmentV2() throws Exception {
// TODO this test should remove after we disable segment v1 completely
Database db = Catalog.getCurrentCatalog().getDb("default_cluster:test");
Assert.assertNotNull(db);
OlapTable tbl = (OlapTable) db.getTable("segmentv2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,27 @@
import org.apache.doris.catalog.Type;
import org.apache.doris.common.util.PropertyAnalyzer;
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.thrift.TStorageFormat;
import org.apache.doris.thrift.TStorageMedium;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class PropertyAnalyzerTest {
@Rule
public ExpectedException expectedEx = ExpectedException.none();

@Test
public void testBfColumns() throws AnalysisException {
Expand Down Expand Up @@ -144,4 +150,21 @@ public void testStorageMedium() throws AnalysisException {
DateLiteral dateLiteral = new DateLiteral(tomorrowTimeStr, Type.DATETIME);
Assert.assertEquals(dateLiteral.unixTimestamp(TimeUtils.getTimeZone()), dataProperty.getCooldownTimeMs());
}

@Test
public void testStorageFormat() throws AnalysisException {
HashMap<String, String> propertiesV1 = Maps.newHashMap();
HashMap<String, String> propertiesV2 = Maps.newHashMap();
HashMap<String, String> propertiesDefault = Maps.newHashMap();
propertiesV1.put(PropertyAnalyzer.PROPERTIES_STORAGE_FORMAT, "v1");
propertiesV2.put(PropertyAnalyzer.PROPERTIES_STORAGE_FORMAT, "v2");
propertiesDefault.put(PropertyAnalyzer.PROPERTIES_STORAGE_FORMAT, "default");
Assert.assertEquals(TStorageFormat.V2, PropertyAnalyzer.analyzeStorageFormat(null));
Assert.assertEquals(TStorageFormat.V2, PropertyAnalyzer.analyzeStorageFormat(propertiesV2));
Assert.assertEquals(TStorageFormat.V2, PropertyAnalyzer.analyzeStorageFormat(propertiesDefault));
expectedEx.expect(AnalysisException.class);
expectedEx.expectMessage("Storage format V1 has been deprecated since version 0.14," +
" please use V2 instead");
PropertyAnalyzer.analyzeStorageFormat(propertiesV1);
}
}