You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/07/08 18:52:27 UTC

[GitHub] [arrow] bkietz opened a new pull request #7686: ARROW-9345: [C++][Dataset] Support casting scalars to dictionary scalars

bkietz opened a new pull request #7686:
URL: https://github.com/apache/arrow/pull/7686


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] pitrou commented on a change in pull request #7686: ARROW-9345: [C++][Dataset] Support casting scalars to dictionary scalars

Posted by GitBox <gi...@apache.org>.
pitrou commented on a change in pull request #7686:
URL: https://github.com/apache/arrow/pull/7686#discussion_r452698706



##########
File path: cpp/src/arrow/scalar_test.cc
##########
@@ -621,10 +622,34 @@ TEST(TestDictionaryScalar, Basics) {
     ASSERT_TRUE(first->Equals(scalar_gamma));
     ASSERT_TRUE(second->Equals(scalar_alpha));
     ASSERT_TRUE(last->Equals(scalar_null));
-  };
+  }
+}
 
-  for (auto ty : all_dictionary_index_types()) {
-    CheckIndexType(ty);
+TEST(TestDictionaryScalar, Cast) {
+  for (auto index_ty : all_dictionary_index_types()) {
+    auto ty = dictionary(index_ty, utf8());
+    auto dict = checked_pointer_cast<StringArray>(
+        ArrayFromJSON(utf8(), R"(["alpha", "beta", "gamma"])"));

Review comment:
       Hmm, perhaps test for null as well?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #7686: ARROW-9345: [C++][Dataset] Support casting scalars to dictionary scalars

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7686:
URL: https://github.com/apache/arrow/pull/7686#issuecomment-655699975


   https://issues.apache.org/jira/browse/ARROW-9345


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] bkietz closed pull request #7686: ARROW-9345: [C++][Dataset] Support casting scalars to dictionary scalars

Posted by GitBox <gi...@apache.org>.
bkietz closed pull request #7686:
URL: https://github.com/apache/arrow/pull/7686


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] bkietz commented on pull request #7686: ARROW-9345: [C++][Dataset] Support casting scalars to dictionary scalars

Posted by GitBox <gi...@apache.org>.
bkietz commented on pull request #7686:
URL: https://github.com/apache/arrow/pull/7686#issuecomment-655728439


   @jorisvandenbossche precisely


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] bkietz commented on pull request #7686: ARROW-9345: [C++][Dataset] Support casting scalars to dictionary scalars

Posted by GitBox <gi...@apache.org>.
bkietz commented on pull request #7686:
URL: https://github.com/apache/arrow/pull/7686#issuecomment-656646681


   The null case doesn't hit the new code here, so I think I'll merge now and add more tests in follow up


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] pitrou commented on a change in pull request #7686: ARROW-9345: [C++][Dataset] Support casting scalars to dictionary scalars

Posted by GitBox <gi...@apache.org>.
pitrou commented on a change in pull request #7686:
URL: https://github.com/apache/arrow/pull/7686#discussion_r452697172



##########
File path: cpp/src/arrow/scalar_test.cc
##########
@@ -581,9 +582,9 @@ TEST(TestStructScalar, FieldAccess) {
 }
 
 TEST(TestDictionaryScalar, Basics) {
-  auto CheckIndexType = [&](const std::shared_ptr<DataType>& index_ty) {

Review comment:
       Ha, this function was never called?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] bkietz commented on pull request #7686: ARROW-9345: [C++][Dataset] Support casting scalars to dictionary scalars

Posted by GitBox <gi...@apache.org>.
bkietz commented on pull request #7686:
URL: https://github.com/apache/arrow/pull/7686#issuecomment-656342273


   @pitrou done, PTAL


----------------------------------------------------------------
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:
users@infra.apache.org