Skip to content
Closed
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
3 changes: 2 additions & 1 deletion be/src/olap/rowset/beta_rowset_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,8 @@ Status BetaRowsetWriter::_do_create_segment_writer(
}
}

auto s = (*writer)->init(block);
auto s = (*writer)->init(_context.schema_change_recorder->has_extended_columns() ? block
: nullptr);
if (!s.ok()) {
LOG(WARNING) << "failed to init segment writer: " << s.to_string();
writer->reset(nullptr);
Expand Down
13 changes: 13 additions & 0 deletions regression-test/data/load_p0/insert/test_insert.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !sql1 --
false -2147483647 7 7
false 103 9 16
false 1002 2 18
false 5014 5 23
false 2147483647 8 31
true -2147483647 4 4
true 3021 1 15
true 3021 10 15
true 25699 6 21
true 2147483647 3 24

31 changes: 31 additions & 0 deletions regression-test/suites/load_p0/insert/test_insert.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,35 @@
suite("test_insert") {
// todo: test insert, such as insert values, insert select, insert txn
sql "show load"

def test_baseall = "test_query_db.baseall";
def test_bigtable = "test_query_db.bigtable";
def insert_tbl = "test_insert_tbl";

sql """ DROP TABLE IF EXISTS ${insert_tbl}"""
sql """
CREATE TABLE ${insert_tbl} (
`k1` char(5) NULL,
`k2` int(11) NULL,
`k3` tinyint(4) NULL,
`k4` int(11) NULL
) ENGINE=OLAP
DUPLICATE KEY(`k1`, `k2`, `k3`, `k4`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`k1`) BUCKETS 5
PROPERTIES (
"replication_num"="1"
);
"""

sql """
INSERT INTO ${insert_tbl}
SELECT a.k6, a.k3, b.k1
, sum(b.k1) OVER (PARTITION BY a.k6 ORDER BY a.k3) AS w_sum
FROM ${test_baseall} a
JOIN ${test_bigtable} b ON a.k1 = b.k1 + 5
ORDER BY a.k6, a.k3, a.k1, w_sum
"""

qt_sql1 "select * from ${insert_tbl} order by 1, 2, 3, 4"
}