Skip to content

Commit 841a721

Browse files
committed
Rename Tuple to Struct_ in flatbuffers IDL
Change-Id: Ifeb6360b4679f154a534b95a06c7ef4decc908d9
1 parent 637584b commit 841a721

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

cpp/src/arrow/ipc/metadata-internal.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static Status TypeFromFlatbuffer(flatbuf::Type type, const void* type_data,
115115
}
116116
*out = std::make_shared<ListType>(children[0]);
117117
return Status::OK();
118-
case flatbuf::Type_Tuple:
118+
case flatbuf::Type_Struct_:
119119
*out = std::make_shared<StructType>(children);
120120
return Status::OK();
121121
case flatbuf::Type_Union:
@@ -153,7 +153,7 @@ static Status StructToFlatbuffer(FBB& fbb, const std::shared_ptr<DataType>& type
153153
RETURN_NOT_OK(FieldToFlatbuffer(fbb, type->child(i), &field));
154154
out_children->push_back(field);
155155
}
156-
*offset = flatbuf::CreateTuple(fbb).Union();
156+
*offset = flatbuf::CreateStruct_(fbb).Union();
157157
return Status::OK();
158158
}
159159

@@ -197,7 +197,7 @@ static Status TypeToFlatbuffer(FBB& fbb, const std::shared_ptr<DataType>& type,
197197
*out_type = flatbuf::Type_List;
198198
return ListToFlatbuffer(fbb, type, children, offset);
199199
case Type::STRUCT:
200-
*out_type = flatbuf::Type_Tuple;
200+
*out_type = flatbuf::Type_Struct_;
201201
return StructToFlatbuffer(fbb, type, children, offset);
202202
default:
203203
*out_type = flatbuf::Type_NONE; // Make clang-tidy happy

format/Message.fbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace org.apache.arrow.flatbuf;
88
table Null {
99
}
1010

11-
/// A Tuple in the flatbuffer metadata is the same as an Arrow Struct
12-
/// (according to the physical memory layout). We used Tuple here as Struct is
13-
/// a reserved word in Flatbuffers
14-
table Tuple {
11+
/// A Struct_ in the flatbuffer metadata is the same as an Arrow Struct
12+
/// (according to the physical memory layout). We used Struct_ here as
13+
/// Struct is a reserved word in Flatbuffers
14+
table Struct_ {
1515
}
1616

1717
table List {
@@ -87,7 +87,7 @@ union Type {
8787
IntervalDay,
8888
IntervalYear,
8989
List,
90-
Tuple,
90+
Struct_,
9191
Union,
9292
JSONScalar
9393
}

java/vector/src/main/codegen/data/ArrowTypes.tdd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
fields: []
2222
},
2323
{
24-
name: "Tuple",
24+
name: "Struct_",
2525
fields: []
2626
},
2727
{

java/vector/src/main/java/org/apache/arrow/vector/complex/MapVector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.apache.arrow.vector.holders.ComplexHolder;
3535
import org.apache.arrow.vector.types.Types;
3636
import org.apache.arrow.vector.types.Types.MinorType;
37-
import org.apache.arrow.vector.types.pojo.ArrowType.Tuple;
37+
import org.apache.arrow.vector.types.pojo.ArrowType.Struct_;
3838
import org.apache.arrow.vector.types.pojo.Field;
3939
import org.apache.arrow.vector.util.CallBack;
4040
import org.apache.arrow.vector.util.JsonStringHashMap;
@@ -290,7 +290,7 @@ public Field getField() {
290290
for (ValueVector child : getChildren()) {
291291
children.add(child.getField());
292292
}
293-
return new Field(name, false, Tuple.INSTANCE, children);
293+
return new Field(name, false, Struct_.INSTANCE, children);
294294
}
295295

296296
@Override

java/vector/src/main/java/org/apache/arrow/vector/schema/TypeLayout.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import org.apache.arrow.vector.types.pojo.ArrowType.Null;
4646
import org.apache.arrow.vector.types.pojo.ArrowType.Time;
4747
import org.apache.arrow.vector.types.pojo.ArrowType.Timestamp;
48-
import org.apache.arrow.vector.types.pojo.ArrowType.Tuple;
48+
import org.apache.arrow.vector.types.pojo.ArrowType.Struct_;
4949
import org.apache.arrow.vector.types.pojo.ArrowType.Union;
5050
import org.apache.arrow.vector.types.pojo.ArrowType.Utf8;
5151

@@ -54,7 +54,7 @@
5454
/**
5555
* The layout of vectors for a given type
5656
* It defines its own vectors followed by the vectors for the children
57-
* if it is a nested type (Tuple, List, Union)
57+
* if it is a nested type (Struct_, List, Union)
5858
*/
5959
public class TypeLayout {
6060

@@ -88,7 +88,7 @@ public static TypeLayout getTypeLayout(final ArrowType arrowType) {
8888
return new TypeLayout(vectors);
8989
}
9090

91-
@Override public TypeLayout visit(Tuple type) {
91+
@Override public TypeLayout visit(Struct_ type) {
9292
List<VectorLayout> vectors = asList(
9393
validityVector()
9494
);

java/vector/src/main/java/org/apache/arrow/vector/types/Types.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
import org.apache.arrow.vector.types.pojo.ArrowType.Null;
8585
import org.apache.arrow.vector.types.pojo.ArrowType.Time;
8686
import org.apache.arrow.vector.types.pojo.ArrowType.Timestamp;
87-
import org.apache.arrow.vector.types.pojo.ArrowType.Tuple;
87+
import org.apache.arrow.vector.types.pojo.ArrowType.Struct_;
8888
import org.apache.arrow.vector.types.pojo.ArrowType.Union;
8989
import org.apache.arrow.vector.types.pojo.ArrowType.Utf8;
9090
import org.apache.arrow.vector.types.pojo.Field;
@@ -131,7 +131,7 @@ public FieldWriter getNewFieldWriter(ValueVector vector) {
131131
return null;
132132
}
133133
},
134-
MAP(Tuple.INSTANCE) {
134+
MAP(Struct_.INSTANCE) {
135135
@Override
136136
public Field getField() {
137137
throw new UnsupportedOperationException("Cannot get simple field for Map type");

java/vector/src/test/java/org/apache/arrow/vector/pojo/TestConvert.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.apache.arrow.vector.types.pojo.ArrowType.Int;
2727
import org.apache.arrow.vector.types.pojo.ArrowType.List;
2828
import org.apache.arrow.vector.types.pojo.ArrowType.Timestamp;
29-
import org.apache.arrow.vector.types.pojo.ArrowType.Tuple;
29+
import org.apache.arrow.vector.types.pojo.ArrowType.Struct_;
3030
import org.apache.arrow.vector.types.pojo.ArrowType.Union;
3131
import org.apache.arrow.vector.types.pojo.ArrowType.Utf8;
3232
import org.apache.arrow.vector.types.pojo.Field;
@@ -53,7 +53,7 @@ public void complex() {
5353
childrenBuilder.add(new Field("child1", true, Utf8.INSTANCE, null));
5454
childrenBuilder.add(new Field("child2", true, new FloatingPoint(SINGLE), ImmutableList.<Field>of()));
5555

56-
Field initialField = new Field("a", true, Tuple.INSTANCE, childrenBuilder.build());
56+
Field initialField = new Field("a", true, Struct_.INSTANCE, childrenBuilder.build());
5757
run(initialField);
5858
}
5959

@@ -71,7 +71,7 @@ public void nestedSchema() {
7171
ImmutableList.Builder<Field> childrenBuilder = ImmutableList.builder();
7272
childrenBuilder.add(new Field("child1", true, Utf8.INSTANCE, null));
7373
childrenBuilder.add(new Field("child2", true, new FloatingPoint(SINGLE), ImmutableList.<Field>of()));
74-
childrenBuilder.add(new Field("child3", true, new Tuple(), ImmutableList.<Field>of(
74+
childrenBuilder.add(new Field("child3", true, new Struct_(), ImmutableList.<Field>of(
7575
new Field("child3.1", true, Utf8.INSTANCE, null),
7676
new Field("child3.2", true, new FloatingPoint(DOUBLE), ImmutableList.<Field>of())
7777
)));

0 commit comments

Comments
 (0)