This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch dev-1.0.1
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit fa6b72617c6415b57602eb7b9c49e235bf4055f1
Author: Mingyu Chen <[email protected]>
AuthorDate: Sun May 29 12:25:41 2022 +0800

    [fix](ut) fix BE ut (#9831)
    
    introduced from #8923, the github checks has some problem that failed to 
check BE ut in #8923
---
 be/test/olap/cumulative_compaction_policy_test.cpp | 12 ++++++------
 be/test/olap/tablet_meta_test.cpp                  |  5 +++--
 be/test/olap/tablet_test.cpp                       |  6 +++---
 be/test/olap/test_data/header_without_inc_rs.txt   |  3 ++-
 gensrc/proto/olap_file.proto                       |  2 +-
 5 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/be/test/olap/cumulative_compaction_policy_test.cpp 
b/be/test/olap/cumulative_compaction_policy_test.cpp
index 950fcbf437..950cc18920 100644
--- a/be/test/olap/cumulative_compaction_policy_test.cpp
+++ b/be/test/olap/cumulative_compaction_policy_test.cpp
@@ -31,9 +31,9 @@ class TestNumBasedCumulativeCompactionPolicy : public 
testing::Test {
 public:
     TestNumBasedCumulativeCompactionPolicy() {}
     void SetUp() {
-        _tablet_meta = static_cast<TabletMetaSharedPtr>(
-                new TabletMeta(1, 2, 15673, 4, 5, TTabletSchema(), 6, {{7, 
8}}, UniqueId(9, 10),
-                               TTabletType::TABLET_TYPE_DISK, 
TStorageMedium::HDD));
+        _tablet_meta = static_cast<TabletMetaSharedPtr>(new TabletMeta(
+                1, 2, 15673, 4, 5, TTabletSchema(), 6, {{7, 8}}, UniqueId(9, 
10),
+                TTabletType::TABLET_TYPE_DISK, TStorageMedium::HDD, 
TCompressionType::LZ4F));
 
         _json_rowset_meta = R"({
             "rowset_id": 540081,
@@ -320,9 +320,9 @@ public:
         config::cumulative_size_based_promotion_min_size_mbytes = 64;
         config::cumulative_size_based_compaction_lower_size_mbytes = 64;
 
-        _tablet_meta = static_cast<TabletMetaSharedPtr>(
-                new TabletMeta(1, 2, 15673, 4, 5, TTabletSchema(), 6, {{7, 
8}}, UniqueId(9, 10),
-                               TTabletType::TABLET_TYPE_DISK, 
TStorageMedium::HDD));
+        _tablet_meta = static_cast<TabletMetaSharedPtr>(new TabletMeta(
+                1, 2, 15673, 4, 5, TTabletSchema(), 6, {{7, 8}}, UniqueId(9, 
10),
+                TTabletType::TABLET_TYPE_DISK, TStorageMedium::HDD, 
TCompressionType::LZ4F));
 
         _json_rowset_meta = R"({
             "rowset_id": 540081,
diff --git a/be/test/olap/tablet_meta_test.cpp 
b/be/test/olap/tablet_meta_test.cpp
index 001651f7fe..448e2ffb10 100644
--- a/be/test/olap/tablet_meta_test.cpp
+++ b/be/test/olap/tablet_meta_test.cpp
@@ -27,8 +27,9 @@ TEST(TabletMetaTest, SaveAndParse) {
     std::string meta_path = "./be/test/olap/test_data/tablet_meta_test.hdr";
 
     TabletMeta old_tablet_meta(1, 2, 3, 4, 5, TTabletSchema(), 6, {{7, 8}}, 
UniqueId(9, 10),
-                               TTabletType::TABLET_TYPE_DISK, 
TStorageMedium::HDD);
-    ASSERT_EQ(OLAP_SUCCESS, old_tablet_meta.save(meta_path));
+                               TTabletType::TABLET_TYPE_DISK, 
TStorageMedium::HDD,
+                               TCompressionType::LZ4F);
+    EXPECT_EQ(Status::OK(), old_tablet_meta.save(meta_path));
 
     {
         // Just to make stack space dirty
diff --git a/be/test/olap/tablet_test.cpp b/be/test/olap/tablet_test.cpp
index a3776d5fb9..ae8bcb6085 100644
--- a/be/test/olap/tablet_test.cpp
+++ b/be/test/olap/tablet_test.cpp
@@ -35,9 +35,9 @@ public:
     virtual ~TestTablet() {}
 
     virtual void SetUp() {
-        _tablet_meta = static_cast<TabletMetaSharedPtr>(
-                new TabletMeta(1, 2, 15673, 4, 5, TTabletSchema(), 6, {{7, 
8}}, UniqueId(9, 10),
-                               TTabletType::TABLET_TYPE_DISK, 
TStorageMedium::HDD));
+        _tablet_meta = static_cast<TabletMetaSharedPtr>(new TabletMeta(
+                1, 2, 15673, 4, 5, TTabletSchema(), 6, {{7, 8}}, UniqueId(9, 
10),
+                TTabletType::TABLET_TYPE_DISK, TStorageMedium::HDD, 
TCompressionType::LZ4F));
         _json_rowset_meta = R"({
             "rowset_id": 540081,
             "tablet_id": 15673,
diff --git a/be/test/olap/test_data/header_without_inc_rs.txt 
b/be/test/olap/test_data/header_without_inc_rs.txt
index 997abdba5c..15fa12797b 100644
--- a/be/test/olap/test_data/header_without_inc_rs.txt
+++ b/be/test/olap/test_data/header_without_inc_rs.txt
@@ -53,7 +53,8 @@
         "delete_sign_idx": -1,
         "sequence_col_idx": -1,
         "sort_type": "LEXICAL",
-        "sort_col_num": 0
+        "sort_col_num": 0,
+        "compression_type": "LZ4F"
     },
     "rs_metas": [
         {
diff --git a/gensrc/proto/olap_file.proto b/gensrc/proto/olap_file.proto
index 43cb8ac7a0..61303f37c5 100644
--- a/gensrc/proto/olap_file.proto
+++ b/gensrc/proto/olap_file.proto
@@ -195,7 +195,7 @@ message TabletSchemaPB {
     optional int32 sequence_col_idx = 10 [default= -1];
     optional SortType sort_type = 11;
     optional int32 sort_col_num = 12;
-    optional segment_v2.CompressionTypePB compression_type = 13;
+    optional segment_v2.CompressionTypePB compression_type = 13 [default=LZ4F];
 }
 
 enum TabletStatePB {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to