Skip to content

Commit eaa9a3c

Browse files
committed
type -> value_type
1 parent b82ad94 commit eaa9a3c

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

cpp/src/arrow/compute/kernels/vector_swizzle_test.cc

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,12 @@ void DoTestScatter(const std::shared_ptr<Array>& values,
467467
DoTestScatterForIndicesTypes(kSignedIntegerTypes, values, indices, max_index, expected);
468468
}
469469

470-
void TestScatter(const std::shared_ptr<DataType>& type, const std::string& values_str,
471-
const std::string& indices_str, int64_t max_index,
472-
const std::string& expected_str) {
473-
auto values = ArrayFromJSON(type, values_str);
470+
void TestScatter(const std::shared_ptr<DataType>& value_type,
471+
const std::string& values_str, const std::string& indices_str,
472+
int64_t max_index, const std::string& expected_str) {
473+
auto values = ArrayFromJSON(value_type, values_str);
474474
auto indices = ArrayFromJSON(int8(), indices_str);
475-
auto expected = ArrayFromJSON(type, expected_str);
475+
auto expected = ArrayFromJSON(value_type, expected_str);
476476
DoTestScatter(values, indices, max_index, expected);
477477
}
478478

@@ -639,141 +639,141 @@ TEST(Scatter, Boolean) {
639639
}
640640

641641
TEST(Scatter, Numeric) {
642-
for (const auto& type : kSignedIntegerTypes) {
643-
ARROW_SCOPED_TRACE(type->ToString());
642+
for (const auto& value_type : kSignedIntegerTypes) {
643+
ARROW_SCOPED_TRACE(value_type->ToString());
644644
{
645645
ARROW_SCOPED_TRACE("Basic");
646646
auto values = "[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]";
647647
auto indices = "[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]";
648648
int64_t max_index = 9;
649649
auto expected = "[19, 18, 17, 16, 15, 14, 13, 12, 11, 10]";
650-
TestScatter(type, values, indices, max_index, expected);
650+
TestScatter(value_type, values, indices, max_index, expected);
651651
}
652652
{
653653
ARROW_SCOPED_TRACE("Values with nulls");
654654
auto values = "[null, 11, null, 13, null, 15, null, 17, null, 19]";
655655
auto indices = "[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]";
656656
int64_t max_index = 9;
657657
auto expected = "[19, null, 17, null, 15, null, 13, null, 11, null]";
658-
TestScatter(type, values, indices, max_index, expected);
658+
TestScatter(value_type, values, indices, max_index, expected);
659659
}
660660
{
661661
ARROW_SCOPED_TRACE("Indices with nulls");
662662
auto values = "[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]";
663663
auto indices = "[9, null, 7, null, 5, null, 3, null, 1, null]";
664664
int64_t max_index = 9;
665665
auto expected = "[null, 18, null, 16, null, 14, null, 12, null, 10]";
666-
TestScatter(type, values, indices, max_index, expected);
666+
TestScatter(value_type, values, indices, max_index, expected);
667667
}
668668
{
669669
ARROW_SCOPED_TRACE("Output greater than input");
670670
auto values = "[0, 0, 0, 1, 1, 1]";
671671
auto indices = "[0, 3, 6, 1, 4, 7]";
672672
int64_t max_index = 8;
673673
auto expected = "[0, 1, null, 0, 1, null, 0, 1, null]";
674-
TestScatter(type, values, indices, max_index, expected);
674+
TestScatter(value_type, values, indices, max_index, expected);
675675
}
676676
{
677677
ARROW_SCOPED_TRACE("Values all null");
678678
auto values = "[null, null]";
679679
auto indices = "[0, 1]";
680680
int64_t max_index = 1;
681681
auto expected = "[null, null]";
682-
TestScatter(type, values, indices, max_index, expected);
682+
TestScatter(value_type, values, indices, max_index, expected);
683683
}
684684
{
685685
ARROW_SCOPED_TRACE("Indices all null");
686686
auto values = "[0, 1]";
687687
auto indices = "[null, null]";
688688
int64_t max_index = 1;
689689
auto expected = "[null, null]";
690-
TestScatter(type, values, indices, max_index, expected);
690+
TestScatter(value_type, values, indices, max_index, expected);
691691
}
692692
{
693693
ARROW_SCOPED_TRACE("Empty input output null");
694694
auto values = "[]";
695695
auto indices = "[]";
696696
int64_t max_index = 1;
697697
auto expected = "[null, null]";
698-
TestScatter(type, values, indices, max_index, expected);
698+
TestScatter(value_type, values, indices, max_index, expected);
699699
}
700700
{
701701
ARROW_SCOPED_TRACE("Indices duplicated indices");
702702
auto values = "[1, 0, null, null]";
703703
auto indices = "[0, 1, 0, 1]";
704704
int64_t max_index = 3;
705705
auto expected = "[null, null, null, null]";
706-
TestScatter(type, values, indices, max_index, expected);
706+
TestScatter(value_type, values, indices, max_index, expected);
707707
}
708708
}
709709
}
710710

711711
TEST(Scatter, Binary) {
712-
for (const auto& type : kBinaryTypes) {
713-
ARROW_SCOPED_TRACE(type->ToString());
712+
for (const auto& value_type : kBinaryTypes) {
713+
ARROW_SCOPED_TRACE(value_type->ToString());
714714
{
715715
ARROW_SCOPED_TRACE("Basic");
716716
auto values = R"(["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"])";
717717
auto indices = "[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]";
718718
int64_t max_index = 9;
719719
auto expected = R"(["j", "i", "h", "g", "f", "e", "d", "c", "b", "a"])";
720-
TestScatter(type, values, indices, max_index, expected);
720+
TestScatter(value_type, values, indices, max_index, expected);
721721
}
722722
{
723723
ARROW_SCOPED_TRACE("Values with nulls");
724724
auto values = R"([null, "b", null, "d", null, "f", null, "h", null, "j"])";
725725
auto indices = "[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]";
726726
int64_t max_index = 9;
727727
auto expected = R"(["j", null, "h", null, "f", null, "d", null, "b", null])";
728-
TestScatter(type, values, indices, max_index, expected);
728+
TestScatter(value_type, values, indices, max_index, expected);
729729
}
730730
{
731731
ARROW_SCOPED_TRACE("Indices with nulls");
732732
auto values = R"(["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"])";
733733
auto indices = "[9, null, 7, null, 5, null, 3, null, 1, null]";
734734
int64_t max_index = 9;
735735
auto expected = R"([null, "i", null, "g", null, "e", null, "c", null, "a"])";
736-
TestScatter(type, values, indices, max_index, expected);
736+
TestScatter(value_type, values, indices, max_index, expected);
737737
}
738738
{
739739
ARROW_SCOPED_TRACE("Output greater than input");
740740
auto values = R"(["a", "a", "a", "b", "b", "b"])";
741741
auto indices = "[0, 3, 6, 1, 4, 7]";
742742
int64_t max_index = 8;
743743
auto expected = R"(["a", "b", null, "a", "b", null, "a", "b", null])";
744-
TestScatter(type, values, indices, max_index, expected);
744+
TestScatter(value_type, values, indices, max_index, expected);
745745
}
746746
{
747747
ARROW_SCOPED_TRACE("Values all null");
748748
auto values = "[null, null]";
749749
auto indices = "[0, 1]";
750750
int64_t max_index = 1;
751751
auto expected = "[null, null]";
752-
TestScatter(type, values, indices, max_index, expected);
752+
TestScatter(value_type, values, indices, max_index, expected);
753753
}
754754
{
755755
ARROW_SCOPED_TRACE("Indices all null");
756756
auto values = R"(["a", "b"])";
757757
auto indices = "[null, null]";
758758
int64_t max_index = 1;
759759
auto expected = "[null, null]";
760-
TestScatter(type, values, indices, max_index, expected);
760+
TestScatter(value_type, values, indices, max_index, expected);
761761
}
762762
{
763763
ARROW_SCOPED_TRACE("Empty input output null");
764764
auto values = "[]";
765765
auto indices = "[]";
766766
int64_t max_index = 1;
767767
auto expected = "[null, null]";
768-
TestScatter(type, values, indices, max_index, expected);
768+
TestScatter(value_type, values, indices, max_index, expected);
769769
}
770770
{
771771
ARROW_SCOPED_TRACE("Indices duplicated indices");
772772
auto values = R"(["a", "b", null, null])";
773773
auto indices = "[0, 1, 0, 1]";
774774
int64_t max_index = 3;
775775
auto expected = "[null, null, null, null]";
776-
TestScatter(type, values, indices, max_index, expected);
776+
TestScatter(value_type, values, indices, max_index, expected);
777777
}
778778
}
779779
}

0 commit comments

Comments
 (0)