jt2594838 commented on code in PR #489: URL: https://github.com/apache/tsfile/pull/489#discussion_r2083824564
########## cpp/src/reader/block/single_device_tsblock_reader.cc: ########## @@ -199,9 +199,15 @@ int SingleDeviceTsBlockReader::fill_ids() { for (const auto& entry : id_column_contexts_) { const auto& id_column_context = entry.second; for (int32_t pos : id_column_context.pos_in_result_) { - common::String device_id( - device_query_task_->get_device_id()->get_segments().at( - id_column_context.pos_in_device_id_)); + common::String device_id; + if (device_query_task_->get_device_id()->segment_num() <= + id_column_context.pos_in_device_id_) { + device_id = common::String(""); + } else { + device_id = common::String( + device_query_task_->get_device_id()->get_segments().at( + id_column_context.pos_in_device_id_)); + } if (RET_FAIL(col_appenders_[pos + 1]->fill( (char*)&device_id, sizeof(device_id), current_block_->get_row_count()))) { Review Comment: We should distinguish null from empty string. ("table1", null, "tag1") is different from ("table1", "", "tag1") -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@tsfile.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org