@@ -1474,16 +1474,16 @@ TEST_F(TestRecordBatch, MakeStatisticsArrayNestedType) {
1474
1474
statistics_struct->null_count = 0 ;
1475
1475
auto struct_array_data = struct_array->data ();
1476
1476
auto statistics_struct_child_a = std::make_shared<ArrayStatistics>();
1477
- statistics_struct_child_a->min = 1 ;
1477
+ statistics_struct_child_a->min = int64_t { 1 } ;
1478
1478
struct_array_data->statistics = statistics_struct;
1479
1479
struct_array_data->child_data [0 ]->statistics = statistics_struct_child_a;
1480
1480
auto array_c = ArrayFromJSON (int64 (), R"( [11,12,13,14,15])" );
1481
1481
array_c->data ()->statistics = std::make_shared<ArrayStatistics>();
1482
- array_c->data ()->statistics ->max = 15 ;
1482
+ array_c->data ()->statistics ->max = int64_t { 15 } ;
1483
1483
auto array_d = ArrayFromJSON (int64 (), R"( [16,17,18,19,20])" );
1484
1484
auto nested_child = struct_nested_stat->data ()->child_data [0 ];
1485
1485
nested_child->statistics = std::make_shared<ArrayStatistics>();
1486
- nested_child->statistics ->max = 5 ;
1486
+ nested_child->statistics ->max = int64_t { 5 } ;
1487
1487
nested_child->statistics ->is_max_exact = true ;
1488
1488
1489
1489
auto rb_schema =
@@ -1492,8 +1492,8 @@ TEST_F(TestRecordBatch, MakeStatisticsArrayNestedType) {
1492
1492
auto rb = RecordBatch::Make (rb_schema, 5 ,
1493
1493
{struct_array, array_c, array_d, struct_nested_stat});
1494
1494
1495
- auto expected_scalar = std::static_pointer_cast<Scalar>(std::shared_ptr <StructScalar>(
1496
- new StructScalar ({ MakeScalar ( int64_t { 5 }), MakeScalar ( int64_t { 10 })}, struct_type) ));
1495
+ auto expected_scalar = internal::checked_pointer_cast <StructScalar>(
1496
+ ScalarFromJSON (struct_type, R"( [5,10] )" ));
1497
1497
auto a = ArrayStatistics::ValueType{std::static_pointer_cast<Scalar>(expected_scalar)};
1498
1498
1499
1499
ASSERT_OK_AND_ASSIGN (
@@ -1536,8 +1536,8 @@ TEST_F(TestRecordBatch, MakeStatisticsArrayNestedNestedType) {
1536
1536
StructArray::Make ({struct_nested_0, struct_nested_1},
1537
1537
{field (" struct_nested_0" , struct_nested_0->type ()),
1538
1538
field (" struct_nested_1" , struct_nested_1->type ())}));
1539
- auto expected_scalar = std::static_pointer_cast<Scalar>(std::shared_ptr <StructScalar>(
1540
- new StructScalar ({ MakeScalar ( int32_t { 5 }), MakeScalar ( int32_t { 10 })}, struct_type) ));
1539
+ auto expected_scalar = internal::checked_pointer_cast <StructScalar>(
1540
+ ScalarFromJSON (struct_type, R"( [5,10] )" ));
1541
1541
auto rb_schema = schema ({field (" struct" , struct_parent->type ())});
1542
1542
auto rb = RecordBatch::Make (rb_schema, 5 , {struct_parent});
1543
1543
0 commit comments