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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <string_view>

#include "olap/rowset/segment_v2/inverted_index/token_stream.h"
#include "olap/rowset/segment_v2/inverted_index/util/reader.h"

namespace doris::segment_v2::inverted_index {

Expand Down
2 changes: 1 addition & 1 deletion be/src/olap/tablet_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t partition_id, int64_t tablet_id
schema->set_inverted_index_storage_format(InvertedIndexStorageFormatPB::V3);
break;
default:
schema->set_inverted_index_storage_format(InvertedIndexStorageFormatPB::V2);
schema->set_inverted_index_storage_format(InvertedIndexStorageFormatPB::V3);
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3039,9 +3039,9 @@ public class Config extends ConfigBase {

@ConfField(mutable = true, masterOnly = true, description = {
"倒排索引默认存储格式",
"Default storage format of inverted index, the default value is V1."
"Default storage format of inverted index, the default value is V3."
})
public static String inverted_index_storage_format = "V2";
public static String inverted_index_storage_format = "V3";

@ConfField(mutable = true, masterOnly = true, description = {
"是否在unique表mow上开启delete语句写delete predicate。若开启,会提升delete语句的性能,"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ public OlapFile.TabletMetaCloudPB.Builder createTabletMetaBuilder(long tableId,
} else if (invertedIndexFileStorageFormat == TInvertedIndexFileStorageFormat.DEFAULT) {
if (Config.inverted_index_storage_format.equalsIgnoreCase("V1")) {
schemaBuilder.setInvertedIndexStorageFormat(OlapFile.InvertedIndexStorageFormatPB.V1);
} else if (Config.inverted_index_storage_format.equalsIgnoreCase("V3")) {
schemaBuilder.setInvertedIndexStorageFormat(OlapFile.InvertedIndexStorageFormatPB.V3);
} else {
} else if (Config.inverted_index_storage_format.equalsIgnoreCase("V2")) {
schemaBuilder.setInvertedIndexStorageFormat(OlapFile.InvertedIndexStorageFormatPB.V2);
} else {
schemaBuilder.setInvertedIndexStorageFormat(OlapFile.InvertedIndexStorageFormatPB.V3);
}
} else {
throw new DdlException("invalid inverted index storage format");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1194,10 +1194,10 @@ public static TInvertedIndexFileStorageFormat analyzeInvertedIndexFileStorageFor
} else {
if (Config.inverted_index_storage_format.equalsIgnoreCase("V1")) {
return TInvertedIndexFileStorageFormat.V1;
} else if (Config.inverted_index_storage_format.equalsIgnoreCase("V3")) {
return TInvertedIndexFileStorageFormat.V3;
} else {
} else if (Config.inverted_index_storage_format.equalsIgnoreCase("V2")) {
return TInvertedIndexFileStorageFormat.V2;
} else {
return TInvertedIndexFileStorageFormat.V3;
}
}

Expand All @@ -1210,10 +1210,10 @@ public static TInvertedIndexFileStorageFormat analyzeInvertedIndexFileStorageFor
} else if (invertedIndexFileStorageFormat.equalsIgnoreCase("default")) {
if (Config.inverted_index_storage_format.equalsIgnoreCase("V1")) {
return TInvertedIndexFileStorageFormat.V1;
} else if (Config.inverted_index_storage_format.equalsIgnoreCase("V3")) {
return TInvertedIndexFileStorageFormat.V3;
} else {
} else if (Config.inverted_index_storage_format.equalsIgnoreCase("V2")) {
return TInvertedIndexFileStorageFormat.V2;
} else {
return TInvertedIndexFileStorageFormat.V3;
}
} else {
throw new AnalysisException("unknown inverted index storage format: " + invertedIndexFileStorageFormat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,49 +289,55 @@ public void testStoragePageSize() throws AnalysisException {

@Test
public void testAnalyzeInvertedIndexFileStorageFormat() throws AnalysisException {
TInvertedIndexFileStorageFormat result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(null);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V2, result);

Config.inverted_index_storage_format = "V1";
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(new HashMap<>());
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V1, result);

Map<String, String> propertiesWithV1 = new HashMap<>();
propertiesWithV1.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "v1");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithV1);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V1, result);

Map<String, String> propertiesWithV2 = new HashMap<>();
propertiesWithV2.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "v2");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithV2);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V2, result);

Map<String, String> propertiesWithV3 = new HashMap<>();
propertiesWithV3.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "v3");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithV3);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V3, result);

Config.inverted_index_storage_format = "V1";
Map<String, String> propertiesWithDefaultV1 = new HashMap<>();
propertiesWithDefaultV1.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "default");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithDefaultV1);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V1, result);

Config.inverted_index_storage_format = "V2";
Map<String, String> propertiesWithDefaultV2 = new HashMap<>();
propertiesWithDefaultV2.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "default");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithDefaultV2);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V2, result);

Map<String, String> propertiesWithUnknown = new HashMap<>();
propertiesWithUnknown.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "unknown_format");
String originFormat = Config.inverted_index_storage_format;
try {
PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithUnknown);
Assertions.fail("Expected AnalysisException was not thrown");
} catch (AnalysisException e) {
Assertions.assertEquals(
"errCode = 2, detailMessage = unknown inverted index storage format: unknown_format",
e.getMessage());
Config.inverted_index_storage_format = "V3";
TInvertedIndexFileStorageFormat result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(null);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V3, result);

Config.inverted_index_storage_format = "V1";
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(new HashMap<>());
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V1, result);

Map<String, String> propertiesWithV1 = new HashMap<>();
propertiesWithV1.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "v1");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithV1);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V1, result);

Map<String, String> propertiesWithV2 = new HashMap<>();
propertiesWithV2.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "v2");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithV2);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V2, result);

Map<String, String> propertiesWithV3 = new HashMap<>();
propertiesWithV3.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "v3");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithV3);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V3, result);

Config.inverted_index_storage_format = "V1";
Map<String, String> propertiesWithDefaultV1 = new HashMap<>();
propertiesWithDefaultV1.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "default");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithDefaultV1);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V1, result);

Config.inverted_index_storage_format = "V2";
Map<String, String> propertiesWithDefaultV2 = new HashMap<>();
propertiesWithDefaultV2.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "default");
result = PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithDefaultV2);
Assertions.assertEquals(TInvertedIndexFileStorageFormat.V2, result);

Map<String, String> propertiesWithUnknown = new HashMap<>();
propertiesWithUnknown.put(PropertyAnalyzer.PROPERTIES_INVERTED_INDEX_STORAGE_FORMAT, "unknown_format");
try {
PropertyAnalyzer.analyzeInvertedIndexFileStorageFormat(propertiesWithUnknown);
Assertions.fail("Expected AnalysisException was not thrown");
} catch (AnalysisException e) {
Assertions.assertEquals(
"errCode = 2, detailMessage = unknown inverted index storage format: unknown_format",
e.getMessage());
}
} finally {
Config.inverted_index_storage_format = originFormat;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !sql --
863

12 changes: 6 additions & 6 deletions regression-test/data/query_p0/system/test_table_properties.out
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal test_table_properties_db duplicate_table file_cache_ttl_seconds 0
internal test_table_properties_db duplicate_table group_commit_data_bytes 134217728
internal test_table_properties_db duplicate_table group_commit_interval_ms 10000
internal test_table_properties_db duplicate_table in_memory false
internal test_table_properties_db duplicate_table inverted_index_storage_format V2
internal test_table_properties_db duplicate_table inverted_index_storage_format V3
internal test_table_properties_db duplicate_table is_being_synced false
internal test_table_properties_db duplicate_table light_schema_change true
internal test_table_properties_db duplicate_table min_load_replica_num -1
Expand Down Expand Up @@ -55,7 +55,7 @@ internal test_table_properties_db listtable file_cache_ttl_seconds 0
internal test_table_properties_db listtable group_commit_data_bytes 134217728
internal test_table_properties_db listtable group_commit_interval_ms 10000
internal test_table_properties_db listtable in_memory false
internal test_table_properties_db listtable inverted_index_storage_format V2
internal test_table_properties_db listtable inverted_index_storage_format V3
internal test_table_properties_db listtable is_being_synced false
internal test_table_properties_db listtable light_schema_change true
internal test_table_properties_db listtable min_load_replica_num -1
Expand Down Expand Up @@ -90,7 +90,7 @@ internal test_table_properties_db unique_table file_cache_ttl_seconds 0
internal test_table_properties_db unique_table group_commit_data_bytes 134217728
internal test_table_properties_db unique_table group_commit_interval_ms 10000
internal test_table_properties_db unique_table in_memory false
internal test_table_properties_db unique_table inverted_index_storage_format V2
internal test_table_properties_db unique_table inverted_index_storage_format V3
internal test_table_properties_db unique_table is_being_synced false
internal test_table_properties_db unique_table light_schema_change true
internal test_table_properties_db unique_table min_load_replica_num -1
Expand Down Expand Up @@ -127,7 +127,7 @@ internal test_table_properties_db duplicate_table file_cache_ttl_seconds 0
internal test_table_properties_db duplicate_table group_commit_data_bytes 134217728
internal test_table_properties_db duplicate_table group_commit_interval_ms 10000
internal test_table_properties_db duplicate_table in_memory false
internal test_table_properties_db duplicate_table inverted_index_storage_format V2
internal test_table_properties_db duplicate_table inverted_index_storage_format V3
internal test_table_properties_db duplicate_table is_being_synced false
internal test_table_properties_db duplicate_table light_schema_change true
internal test_table_properties_db duplicate_table min_load_replica_num -1
Expand Down Expand Up @@ -162,7 +162,7 @@ internal test_table_properties_db unique_table file_cache_ttl_seconds 0
internal test_table_properties_db unique_table group_commit_data_bytes 134217728
internal test_table_properties_db unique_table group_commit_interval_ms 10000
internal test_table_properties_db unique_table in_memory false
internal test_table_properties_db unique_table inverted_index_storage_format V2
internal test_table_properties_db unique_table inverted_index_storage_format V3
internal test_table_properties_db unique_table is_being_synced false
internal test_table_properties_db unique_table light_schema_change true
internal test_table_properties_db unique_table min_load_replica_num -1
Expand Down Expand Up @@ -201,7 +201,7 @@ internal test_table_properties_db duplicate_table file_cache_ttl_seconds 0
internal test_table_properties_db duplicate_table group_commit_data_bytes 134217728
internal test_table_properties_db duplicate_table group_commit_interval_ms 10000
internal test_table_properties_db duplicate_table in_memory false
internal test_table_properties_db duplicate_table inverted_index_storage_format V2
internal test_table_properties_db duplicate_table inverted_index_storage_format V3
internal test_table_properties_db duplicate_table is_being_synced false
internal test_table_properties_db duplicate_table light_schema_change true
internal test_table_properties_db duplicate_table min_load_replica_num -1
Expand Down
Loading
Loading