diff --git a/be/src/storage/delta_writer.cpp b/be/src/storage/delta_writer.cpp index 32876722360970..7a4fd159466fb1 100644 --- a/be/src/storage/delta_writer.cpp +++ b/be/src/storage/delta_writer.cpp @@ -371,7 +371,7 @@ Status DeltaWriter::write(const Chunk& chunk, const uint32_t* indexes, uint32_t _opt.tablet_id, _replica_state_name(_replica_state))); } - if (!_mem_table->check_supported_column_partial_update(chunk)) { + if (_tablet->keys_type() == KeysType::PRIMARY_KEYS && !_mem_table->check_supported_column_partial_update(chunk)) { return Status::InternalError( fmt::format("can't partial update for column with row. tablet_id: {}", _opt.tablet_id)); } diff --git a/be/src/storage/memtable.cpp b/be/src/storage/memtable.cpp index 734c9f20c00dd1..5a5da654e8d444 100644 --- a/be/src/storage/memtable.cpp +++ b/be/src/storage/memtable.cpp @@ -166,21 +166,24 @@ bool MemTable::insert(const Chunk& chunk, const uint32_t* indexes, uint32_t from } bool is_column_with_row = false; - std::unique_ptr schema_without_full_row_column; auto full_row_col = std::make_unique(); - if (_vectorized_schema->field_names().back() == "__row") { - DCHECK_EQ(chunk.num_columns(), _vectorized_schema->num_fields() - 1); - std::vector cids(_vectorized_schema->num_fields() - 1); - for (int i = 0; i < _vectorized_schema->num_fields() - 1; i++) { - cids[i] = i; + if (_keys_type == PRIMARY_KEYS) { + std::unique_ptr schema_without_full_row_column; + if (_vectorized_schema->field_names().back() == "__row") { + DCHECK_EQ(chunk.num_columns(), _vectorized_schema->num_fields() - 1); + std::vector cids(_vectorized_schema->num_fields() - 1); + for (int i = 0; i < _vectorized_schema->num_fields() - 1; i++) { + cids[i] = i; + } + schema_without_full_row_column = std::make_unique(const_cast(_vectorized_schema), cids); + is_column_with_row = true; + // add row column + auto row_encoder = RowStoreEncoderFactory::instance()->get_or_create_encoder(SIMPLE); + (void)row_encoder->encode_chunk_to_full_row_column(*schema_without_full_row_column, chunk, + full_row_col.get()); + } else { + DCHECK_EQ(chunk.num_columns(), _vectorized_schema->num_fields()); } - schema_without_full_row_column = std::make_unique(const_cast(_vectorized_schema), cids); - is_column_with_row = true; - // add row column - auto row_encoder = RowStoreEncoderFactory::instance()->get_or_create_encoder(SIMPLE); - (void)row_encoder->encode_chunk_to_full_row_column(*schema_without_full_row_column, chunk, full_row_col.get()); - } else { - DCHECK_EQ(chunk.num_columns(), _vectorized_schema->num_fields()); } size_t cur_row_count = _chunk->num_rows();