Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cases](nested-types)run master cases for nested types #38329

Open
wants to merge 7 commits into
base: branch-2.0
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 8 additions & 2 deletions be/src/vec/data_types/get_least_supertype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ void get_numeric_type(const TypeIndexSet& types, DataTypePtr* type, bool compati
} else if (min_bit_width_of_integer <= 64) {
*type = std::make_shared<DataTypeInt64>();
return;
} else {
} else if (min_bit_width_of_integer <= 128) {
*type = std::make_shared<DataTypeInt128>();
return;
} else {
LOG(INFO) << " because some of them are signed integers and some are unsigned "
"integers, but there is no signed integer type, that can exactly "
"represent all required unsigned integer values";
Expand All @@ -202,7 +205,10 @@ void get_numeric_type(const TypeIndexSet& types, DataTypePtr* type, bool compati
} else if (min_bit_width_of_integer <= 64) {
*type = std::make_shared<DataTypeUInt64>();
return;
} else {
} else if (min_bit_width_of_integer <= 128) {
*type = std::make_shared<DataTypeUInt128>();
return;
} else {
LOG(WARNING) << "Logical error: "
<< "but as all data types are unsigned integers, we must have found "
"maximum unsigned integer type";
Expand Down
16 changes: 10 additions & 6 deletions be/src/vec/exprs/lambda_function/varray_map_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ class ArrayMapFunction : public LambdaFunction {
// offset column
MutableColumnPtr array_column_offset;
int nested_array_column_rows = 0;
const ColumnArray::Offsets64* array_offsets = nullptr;
ColumnPtr first_array_offsets = nullptr;

//2. get the result column from executed expr, and the needed is nested column of array
Block lambda_block;
for (int i = 0; i < arguments.size(); ++i) {
Expand Down Expand Up @@ -113,18 +114,21 @@ class ArrayMapFunction : public LambdaFunction {

if (i == 0) {
nested_array_column_rows = col_array.get_data_ptr()->size();
array_offsets = &col_array.get_offsets();
first_array_offsets = col_array.get_offsets_ptr();
auto& off_data = assert_cast<const ColumnArray::ColumnOffsets&>(
col_array.get_offsets_column());
array_column_offset = off_data.clone_resized(col_array.get_offsets_column().size());
} else {
// select array_map((x,y)->x+y,c_array1,[0,1,2,3]) from array_test2;
// c_array1: [0,1,2,3,4,5,6,7,8,9]
auto& array_offsets =
assert_cast<const ColumnArray::ColumnOffsets&>(*first_array_offsets)
.get_data();
if (nested_array_column_rows != col_array.get_data_ptr()->size() ||
(array_offsets->size() > 0 &&
memcmp(array_offsets->data(), col_array.get_offsets().data(),
sizeof((*array_offsets)[0]) * array_offsets->size()) != 0)) {
return Status::InternalError(
(array_offsets.size() > 0 &&
memcmp(array_offsets.data(), col_array.get_offsets().data(),
sizeof(array_offsets[0]) * array_offsets.size()) != 0)) {
return Status::InvalidArgument(
"in array map function, the input column size "
"are "
"not equal completely, nested column data rows 1st size is {}, {}th "
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/functions/function_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class FunctionMap : public IFunction {
size_t num_element = arguments.size();

auto result_col = block.get_by_position(result).type->create_column();
auto map_column = typeid_cast<ColumnMap*>(result_col.get());
auto* map_column = typeid_cast<ColumnMap*>(result_col.get());
if (!map_column) {
return Status::RuntimeError("unsupported types for function {} return {}", get_name(),
block.get_by_position(result).type->get_name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2453,6 +2453,9 @@ public class Config extends ConfigBase {
"Stream_Load When importing, the maximum length of label is limited"})
public static int label_regex_length = 128;

@ConfField(mutable = true)
public static boolean enable_create_inverted_index_for_array = false;

@ConfField(mutable = true, masterOnly = true)
public static boolean enable_create_bitmap_index_as_inverted_index = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.doris.catalog.KeysType;
import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.Config;

import com.google.common.base.Strings;
import com.google.common.collect.Lists;
Expand Down Expand Up @@ -236,6 +237,9 @@ public void checkColumn(Column column, KeysType keysType, boolean enableUniqueKe
}

if (indexType == IndexType.INVERTED) {
if (!Config.enable_create_inverted_index_for_array && colType.isArrayType()) {
throw new AnalysisException("inverted index does not support array type column:" + indexColName);
}
InvertedIndexUtil.checkInvertedIndexParser(indexColName, colType, properties);
} else if (indexType == IndexType.NGRAM_BF) {
if (colType != PrimitiveType.CHAR && colType != PrimitiveType.VARCHAR
Expand Down
Loading
Loading