wesm commented on a change in pull request #7684:
URL: https://github.com/apache/arrow/pull/7684#discussion_r453807979
##########
File path: cpp/src/arrow/array/array_test.cc
##########
@@ -384,6 +398,40 @@ TEST_F(TestArray, TestMakeArrayFromScalar) {
}
}
+TEST_F(TestArray, TestMakeArrayFromDictionaryScalar) {
+ auto dictionary = ArrayFromJSON(utf8(), R"(["foo", "bar", "baz"])");
+ auto type = std::make_shared<DictionaryType>(int8(), utf8());
Review comment:
`::arrow::dictionary` works too
##########
File path: cpp/src/arrow/array/array_test.cc
##########
@@ -384,6 +398,40 @@ TEST_F(TestArray, TestMakeArrayFromScalar) {
}
}
+TEST_F(TestArray, TestMakeArrayFromDictionaryScalar) {
+ auto dictionary = ArrayFromJSON(utf8(), R"(["foo", "bar", "baz"])");
+ auto type = std::make_shared<DictionaryType>(int8(), utf8());
+ ASSERT_OK_AND_ASSIGN(auto value, MakeScalar(int8(), 1));
+ auto scalar = DictionaryScalar({value, dictionary}, type);
Review comment:
Note you can also do `DictionaryScalar scalar({..., `
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]