Remove unused code and unnecessary check (#1918)

This commit is contained in:
kangkaisen
2019-09-30 18:35:30 +08:00
committed by ZHAO Chun
parent 8aa8e08f27
commit 4e8d728e75
8 changed files with 3 additions and 49 deletions

View File

@ -149,8 +149,7 @@ OLAPStatus DeleteConditionHandler::check_condition_valid(
valid_condition = valid_unsigned_number<uint64_t>(value_str);
} else if (field_type == OLAP_FIELD_TYPE_DECIMAL) {
valid_condition = valid_decimal(value_str, column.precision(), column.frac());
} else if (field_type == OLAP_FIELD_TYPE_CHAR || field_type == OLAP_FIELD_TYPE_VARCHAR
|| field_type == OLAP_FIELD_TYPE_HLL) {
} else if (field_type == OLAP_FIELD_TYPE_CHAR || field_type == OLAP_FIELD_TYPE_VARCHAR) {
if (value_str.size() <= column.length()) {
valid_condition = true;
}

View File

@ -17,7 +17,6 @@
#include "olap/memtable.h"
#include "olap/hll.h"
#include "olap/rowset/column_data_writer.h"
#include "olap/row_cursor.h"
#include "olap/row.h"

View File

@ -1064,8 +1064,7 @@ OLAPStatus Reader::_init_load_bf_columns(const ReaderParams& read_params) {
return res;
}
type = _tablet->tablet_schema().column(max_equal_index).type();
if ((type != OLAP_FIELD_TYPE_VARCHAR && type != OLAP_FIELD_TYPE_HLL)
|| max_equal_index + 1 > _tablet->num_short_key_columns()) {
if (type != OLAP_FIELD_TYPE_VARCHAR || max_equal_index + 1 > _tablet->num_short_key_columns()) {
_load_bf_columns.erase(max_equal_index);
}

View File

@ -131,9 +131,6 @@ private:
// Field offset of memory row format, used to get field ptr in memory row
std::vector<size_t> _field_offset_in_memory;
// Data in storage will be construct of two parts: fixed-length field stored in ahead
// of buffer; content of variable length field(Varchar/HLL) are stored after first part
// only used for SegmentReader to covert VectorizedRowBatch to RowBlock
// Be careful to use this
size_t _pos = 0;

View File

@ -731,31 +731,6 @@ OLAPStatus SegmentReader::_load_index(bool is_using_cache) {
return OLAP_SUCCESS;
}
int32_t SegmentReader::_get_index_position(ColumnEncodingMessage::Kind encoding_kind,
std::string type,
StreamInfoMessage::Kind stream_kind,
bool is_compressed,
bool has_null) {
if (stream_kind == StreamInfoMessage::PRESENT) {
return 0;
}
int32_t compressionValue = 1;
int32_t base = has_null ? (BITFIELD_POSITIONS + compressionValue) : 0;
// TODO. 將column的type轉換爲int類型
std::string type_copy = type;
transform(type_copy.begin(), type_copy.end(), type_copy.begin(), toupper);
if (type == "VARCHAR" || type == "HLL" || type == "CHAR") {
if (encoding_kind == ColumnEncodingMessage::DIRECT &&
stream_kind != StreamInfoMessage::DATA) {
return base + BYTE_STREAM_POSITIONS + compressionValue;
}
}
return base;
}
OLAPStatus SegmentReader::_read_all_data_streams(size_t* buffer_size) {
int64_t stream_offset = _header_length;
uint64_t stream_length = 0;

View File

@ -186,20 +186,6 @@ private:
// 加载索引,将需要的列的索引读入内存
OLAPStatus _load_index(bool is_using_cache);
// 根据列类型返回stream偏移在索引的position数组的哪个位置。在有过滤条件时,
// 需要根据这个偏移来确认实际读取的stream段偏移和长度。
// @param encoding_kind 字符串的编码方式,字典还是直接编码
// @param type 列类型
// @param stream_kind 流类型
// @param is_compressed 是否压缩
// @param has_null 是否含有空值
// @return 返回索引位置
int32_t _get_index_position(ColumnEncodingMessage::Kind encoding_kind,
std::string type,
StreamInfoMessage::Kind stream_kind,
bool is_compressed,
bool has_null);
// 读出所有列,完整的流,(这里只是创建stream,在orc file里因为没有mmap因
// 此意味着实际的数据读取, 而在这里并没有实际的读,只是圈出来需要的范围)
OLAPStatus _read_all_data_streams(size_t* buffer_size);

View File

@ -17,7 +17,6 @@
#include "olap/stream_index_common.h"
#include "olap/stream_index_common.h"
#include "olap/field.h"
#include "olap/wrapper_field.h"

View File

@ -126,7 +126,7 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t partition_id,
tcolumn.column_type.type, tcolumn.column_type.len);
column->set_length(length);
column->set_index_length(length);
if (tcolumn.column_type.type == TPrimitiveType::VARCHAR || tcolumn.column_type.type == TPrimitiveType::HLL) {
if (tcolumn.column_type.type == TPrimitiveType::VARCHAR) {
if (!tcolumn.column_type.__isset.index_len) {
column->set_index_length(10);
} else {