Skip to content

Commit

Permalink
change make_numeric_array
Browse files Browse the repository at this point in the history
  • Loading branch information
sgilmore10 committed Jun 11, 2024
1 parent e14c051 commit b78622c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crash-repro/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@


template <typename CType>
arrow::Result<std::shared_ptr<arrow::Array>> make_numeric_array(std::vector<CType> values) {
arrow::Result<std::shared_ptr<arrow::Array>> make_numeric_array() { //std::vector<CType> values) {
using TypeClass = typename arrow::CTypeTraits<CType>::ArrowType;

std::cout << "create builder" << std::endl;
std::vector<CType> values = {1, 2, 3};
std::cout << "create builder" << std::endl;

arrow::NumericBuilder<TypeClass> builder;
std::cout << "append values" << std::endl;
std::cout << "append values" << std::endl;

ARROW_RETURN_NOT_OK(builder.AppendValues(values));
std::cout << "done values" << std::endl;
Expand All @@ -48,10 +48,10 @@ arrow::Result<std::shared_ptr<arrow::Array>> make_numeric_array(std::vector<CTyp
}

arrow::Result<std::shared_ptr<arrow::Table>> make_table() {
std::vector<int32_t> doubleValues = {1, 2, 3, 4};
std::vector<int32_t> int32Values = {1, 2, 3, 4};
//std::vector<int32_t> doubleValues = {1, 2, 3, 4};
st//d::vector<int32_t> int32Values = {1, 2, 3, 4};
std::cout << "1" << std::endl;
auto maybeDoubleArray = make_numeric_array(doubleValues);
auto maybeDoubleArray = make_numeric_array<double>(); //doubleValues);
if (!maybeDoubleArray.ok()) {
std::cout << "Status is : " << maybeDoubleArray.status().message() << std::endl;
}
Expand All @@ -62,7 +62,7 @@ arrow::Result<std::shared_ptr<arrow::Table>> make_table() {

std::cout << "2" << std::endl;

ARROW_ASSIGN_OR_RAISE(auto int32Array, make_numeric_array(int32Values));
ARROW_ASSIGN_OR_RAISE(auto int32Array, make_numeric_array()); //int32Values));
std::cout << "3" << std::endl;

std::vector<std::shared_ptr<arrow::Array>> columns = {doubleArray, int32Array};
Expand Down

0 comments on commit b78622c

Please sign in to comment.