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/11/19 20:41:38 UTC

[GitHub] [arrow] KirillLykov commented on a change in pull request #8461: ARROW-10197: [python][Gandiva] Execute expression on filtered data

KirillLykov commented on a change in pull request #8461:
URL: https://github.com/apache/arrow/pull/8461#discussion_r527184657



##########
File path: python/pyarrow/includes/libgandiva.pxd
##########
@@ -58,6 +67,31 @@ cdef extern from "gandiva/selection_vector.h" namespace "gandiva" nogil:
             int64_t max_slots, CMemoryPool* pool,
             shared_ptr[CSelectionVector]* selection_vector)
 
+cdef inline CSelectionVector_Mode _ensure_selection_mode(str name) except *:
+    uppercase = name.upper()
+    if uppercase == 'NONE':
+        return CSelectionVector_Mode_NONE
+    elif uppercase == 'UINT16':
+        return CSelectionVector_Mode_UINT16
+    elif uppercase == 'UINT32':
+        return CSelectionVector_Mode_UINT32
+    elif uppercase == 'UINT64':
+        return CSelectionVector_Mode_UINT64
+    else:
+        raise ValueError('Invalid value for Selection Mode: {!r}'.format(name))
+
+cdef inline str _selection_mode_name(CSelectionVector_Mode ctype):

Review comment:
       It cannot be added because `Exception clause not allowed for function returning Python object`




----------------------------------------------------------------
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