Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions c_glib/arrow-glib/composite-data-type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ garrow_union_data_type_get_field(GArrowUnionDataType *union_data_type,
*
* Since: 0.12.0
*/
guint8 *
gint8 *
garrow_union_data_type_get_type_codes(GArrowUnionDataType *union_data_type,
gsize *n_type_codes)
{
Expand All @@ -446,7 +446,7 @@ garrow_union_data_type_get_type_codes(GArrowUnionDataType *union_data_type,

const auto arrow_type_codes = arrow_union_data_type->type_codes();
const auto n = arrow_type_codes.size();
auto type_codes = static_cast<guint8 *>(g_new(guint8, n));
auto type_codes = static_cast<gint8 *>(g_new(gint8, n));
for (size_t i = 0; i < n; ++i) {
type_codes[i] = arrow_type_codes[i];
}
Expand Down Expand Up @@ -479,7 +479,7 @@ garrow_sparse_union_data_type_class_init(GArrowSparseUnionDataTypeClass *klass)
*/
GArrowSparseUnionDataType *
garrow_sparse_union_data_type_new(GList *fields,
guint8 *type_codes,
gint8 *type_codes,
gsize n_type_codes)
{
std::vector<std::shared_ptr<arrow::Field>> arrow_fields;
Expand All @@ -489,7 +489,7 @@ garrow_sparse_union_data_type_new(GList *fields,
arrow_fields.push_back(arrow_field);
}

std::vector<uint8_t> arrow_type_codes;
std::vector<int8_t> arrow_type_codes;
for (gsize i = 0; i < n_type_codes; ++i) {
arrow_type_codes.push_back(type_codes[i]);
}
Expand Down Expand Up @@ -529,7 +529,7 @@ garrow_dense_union_data_type_class_init(GArrowDenseUnionDataTypeClass *klass)
*/
GArrowDenseUnionDataType *
garrow_dense_union_data_type_new(GList *fields,
guint8 *type_codes,
gint8 *type_codes,
gsize n_type_codes)
{
std::vector<std::shared_ptr<arrow::Field>> arrow_fields;
Expand All @@ -539,7 +539,7 @@ garrow_dense_union_data_type_new(GList *fields,
arrow_fields.push_back(arrow_field);
}

std::vector<uint8_t> arrow_type_codes;
std::vector<int8_t> arrow_type_codes;
for (gsize i = 0; i < n_type_codes; ++i) {
arrow_type_codes.push_back(type_codes[i]);
}
Expand Down
6 changes: 3 additions & 3 deletions c_glib/arrow-glib/composite-data-type.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ garrow_union_data_type_get_fields(GArrowUnionDataType *union_data_type);
GArrowField *
garrow_union_data_type_get_field(GArrowUnionDataType *union_data_type,
gint i);
guint8 *
gint8 *
garrow_union_data_type_get_type_codes(GArrowUnionDataType *union_data_type,
gsize *n_type_codes);

Expand All @@ -127,7 +127,7 @@ struct _GArrowSparseUnionDataTypeClass

GArrowSparseUnionDataType *
garrow_sparse_union_data_type_new(GList *fields,
guint8 *type_codes,
gint8 *type_codes,
gsize n_type_codes);


Expand All @@ -145,7 +145,7 @@ struct _GArrowDenseUnionDataTypeClass

GArrowDenseUnionDataType *
garrow_dense_union_data_type_new(GList *fields,
guint8 *type_codes,
gint8 *type_codes,
gsize n_type_codes);


Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ set(ARROW_SRCS
array/concatenate.cc
array/dict_internal.cc
array/diff.cc
array/validate.cc
buffer.cc
compare.cc
extension_type.cc
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/adapters/orc/adapter_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,12 @@ Status GetArrowType(const liborc::Type* type, std::shared_ptr<DataType>* out) {
}
case liborc::UNION: {
std::vector<std::shared_ptr<Field>> fields;
std::vector<uint8_t> type_codes;
std::vector<int8_t> type_codes;
for (int child = 0; child < subtype_count; ++child) {
std::shared_ptr<DataType> elemtype;
RETURN_NOT_OK(GetArrowType(type->getSubtype(child), &elemtype));
fields.push_back(field("_union_" + std::to_string(child), elemtype));
type_codes.push_back(static_cast<uint8_t>(child));
type_codes.push_back(static_cast<int8_t>(child));
}
*out = union_(fields, type_codes);
break;
Expand Down
Loading