Skip to content

Commit 77d1414

Browse files
committed
upd
1 parent 2dc0d0a commit 77d1414

18 files changed

Lines changed: 36 additions & 35 deletions

‎be/src/core/column/column_struct.cpp‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Field ColumnStruct::operator[](size_t n) const {
107107
void ColumnStruct::get(size_t n, Field& res) const {
108108
const size_t tuple_size = columns.size();
109109

110-
res = Field::create_field<TYPE_STRUCT>(Tuple());
110+
res = Field::create_field<TYPE_STRUCT>(Struct());
111111
auto& res_tuple = res.get<TYPE_STRUCT>();
112112
res_tuple.reserve(tuple_size);
113113

@@ -121,10 +121,11 @@ void ColumnStruct::insert(const Field& x) {
121121
const auto& tuple = x.get<TYPE_STRUCT>();
122122
const size_t tuple_size = columns.size();
123123
if (tuple.size() != tuple_size) {
124-
throw doris::Exception(ErrorCode::INTERNAL_ERROR,
125-
"Cannot insert value of different size into tuple. field tuple size "
126-
"{}, columns size {}",
127-
tuple.size(), tuple_size);
124+
throw doris::Exception(
125+
ErrorCode::INTERNAL_ERROR,
126+
"Cannot insert value of different size into struct. field struct size "
127+
"{}, columns size {}",
128+
tuple.size(), tuple_size);
128129
}
129130

130131
for (size_t i = 0; i < tuple_size; ++i) {
@@ -138,7 +139,7 @@ void ColumnStruct::insert_from(const IColumn& src_, size_t n) {
138139
const size_t tuple_size = columns.size();
139140
if (src.columns.size() != tuple_size) {
140141
throw doris::Exception(ErrorCode::INTERNAL_ERROR,
141-
"Cannot insert value of different size into tuple.");
142+
"Cannot insert value of different size into struct.");
142143
__builtin_unreachable();
143144
}
144145

‎be/src/core/data_type/convert_field_to_type.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class FieldVisitorToJsonb : public StaticVisitor<void> {
215215
}
216216
void operator()(const Array& x, JsonbWriter* writer) const;
217217

218-
void operator()(const Tuple& x, JsonbWriter* writer) const {
218+
void operator()(const Struct& x, JsonbWriter* writer) const {
219219
throw doris::Exception(doris::ErrorCode::NOT_IMPLEMENTED_ERROR, "Not implemeted");
220220
}
221221
void operator()(const Decimal32& x, JsonbWriter* writer) const {

‎be/src/core/data_type/data_type.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class IDataType : private boost::noncopyable {
131131

132132
virtual bool equals_ignore_precision(const IDataType& rhs) const { return equals(rhs); }
133133

134-
/** Example: numbers, Date, DateTime, FixedString, Enum... Nullable and Tuple of such types.
134+
/** Example: numbers, Date, DateTime, FixedString, Enum... Nullable and Struct of such types.
135135
* Counterexamples: String, Array.
136136
* It's Ok to return false for AggregateFunction despite the fact that some of them have fixed size state.
137137
*/

‎be/src/core/data_type/data_type_struct.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ static Status check_tuple_names(const Strings& names) {
6161
std::unordered_set<String> names_set;
6262
for (const auto& name : names) {
6363
if (name.empty()) {
64-
return Status::InvalidArgument("Names of tuple elements cannot be empty");
64+
return Status::InvalidArgument("Names of struct elements cannot be empty");
6565
}
6666

6767
if (!names_set.insert(name).second) {
68-
return Status::InvalidArgument("Names of tuple elements must be unique");
68+
return Status::InvalidArgument("Names of struct elements must be unique");
6969
}
7070
}
7171

‎be/src/core/data_type/primitive_type.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ColumnVarbinary;
4747
using ColumnString = ColumnStr<UInt32>;
4848
class JsonbField;
4949
struct Array;
50-
struct Tuple;
50+
struct Struct;
5151
struct Map;
5252
struct FieldWithDataType;
5353
using VariantMap = std::map<PathInData, FieldWithDataType>;
@@ -487,7 +487,7 @@ struct PrimitiveTypeTraits<TYPE_MAP> {
487487
};
488488
template <>
489489
struct PrimitiveTypeTraits<TYPE_STRUCT> {
490-
using CppType = Tuple;
490+
using CppType = Struct;
491491
using StorageFieldType = CppType;
492492
using DataType = DataTypeStruct;
493493
using ColumnType = ColumnStruct;

‎be/src/core/field.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ class Field;
5858

5959
using FieldVector = std::vector<Field>;
6060

61-
/// Array and Tuple use the same storage type -- FieldVector, but we declare
61+
/// Array and Struct use the same storage type -- FieldVector, but we declare
6262
/// distinct types for them, so that the caller can choose whether it wants to
63-
/// construct a Field of Array or a Tuple type. An alternative approach would be
63+
/// construct a Field of Array or a Struct type. An alternative approach would be
6464
/// to construct both of these types from FieldVector, and have the caller
6565
/// specify the desired Field type explicitly.
6666
struct Array : public FieldVector {
6767
using FieldVector::FieldVector;
6868
};
6969

70-
struct Tuple : public FieldVector {
70+
struct Struct : public FieldVector {
7171
using FieldVector::FieldVector;
7272
};
7373

@@ -286,7 +286,7 @@ class Field {
286286

287287
private:
288288
std::aligned_union_t<DBMS_MIN_FIELD_SIZE - sizeof(PrimitiveType), Null, UInt64, UInt128, Int64,
289-
Int128, IPv6, Float64, String, JsonbField, StringView, Array, Tuple, Map,
289+
Int128, IPv6, Float64, String, JsonbField, StringView, Array, Struct, Map,
290290
VariantMap, Decimal32, Decimal64, DecimalV2Value, Decimal128V3, Decimal256,
291291
BitmapValue, HyperLogLog, QuantileState>
292292
storage;

‎be/src/exprs/vstruct_literal.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace doris {
3636
Status VStructLiteral::prepare(RuntimeState* state, const RowDescriptor& row_desc,
3737
VExprContext* context) {
3838
RETURN_IF_ERROR_OR_PREPARED(VExpr::prepare(state, row_desc, context));
39-
Field struct_field = Field::create_field<TYPE_STRUCT>(Tuple());
39+
Field struct_field = Field::create_field<TYPE_STRUCT>(Struct());
4040
for (const auto& child : _children) {
4141
Field item;
4242
auto child_literal = std::dynamic_pointer_cast<const VLiteral>(child);

‎be/src/util/json/json_parser.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ StringRef JSONDataParser<ParserImpl>::getNameOfNested(const PathInData::Parts& p
369369
return {};
370370
}
371371
/// Find first key that is marked as nested,
372-
/// because we may have tuple of Nested and there could be
372+
/// because we may have struct of Nested and there could be
373373
/// several arrays with the same prefix, but with independent sizes.
374-
/// Consider we have array element with type `k2 Tuple(k3 Nested(...), k5 Nested(...))`
374+
/// Consider we have array element with type `k2 Struct(k3 Nested(...), k5 Nested(...))`
375375
/// Then subcolumns `k2.k3` and `k2.k5` may have indepented sizes and we should extract
376376
/// `k3` and `k5` keys instead of `k2`.
377377
for (const auto& part : path) {

‎be/test/core/column/column_hash_func_test.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ TEST(HashFuncTest, StructTypeTestWithSepcificValueCrcHash) {
239239
dataTypes.push_back(n1);
240240
dataTypes.push_back(s1);
241241

242-
Tuple t;
242+
Struct t;
243243
t.push_back(Field::create_field<TYPE_BIGINT>(Int64(1)));
244244
t.push_back(Field::create_field<TYPE_STRING>("hello"));
245245

‎be/test/core/column/column_variant_test.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,9 +2767,9 @@ TEST_F(ColumnVariantTest, get_field_info_all_types) {
27672767
EXPECT_EQ(info.scalar_type_id, PrimitiveType::TYPE_JSONB);
27682768
}
27692769

2770-
// Test Tuple
2770+
// Test Struct
27712771
{
2772-
Tuple t1;
2772+
Struct t1;
27732773
t1.push_back(Field::create_field<TYPE_STRING>(String("amory cute")));
27742774
t1.push_back(Field::create_field<TYPE_BIGINT>(Int64(37)));
27752775
t1.push_back(Field::create_field<TYPE_BOOLEAN>(true));

0 commit comments

Comments
 (0)