augustoasilva commented on a change in pull request #11054:
URL: https://github.com/apache/arrow/pull/11054#discussion_r747903190
##########
File path: cpp/src/gandiva/precompiled/string_ops.cc
##########
@@ -1361,6 +1361,26 @@ gdv_int32 ascii_utf8(const char* data, gdv_int32
data_len) {
return static_cast<gdv_int32>(data[0]);
}
+// Returns the ASCII character having the binary equivalent to A.
+// If A is larger than 256 the result is equivalent to chr(A % 256).
+GANDIVA_EXPORT
+const char* chr_int32(gdv_int64 context, gdv_int32 in, gdv_int32* out_len) {
+ in = in % 256;
+ if (in <= 0) {
Review comment:
It now returns the '\0' character which represents the NULL character
##########
File path: cpp/src/gandiva/precompiled/string_ops.cc
##########
@@ -1361,6 +1361,26 @@ gdv_int32 ascii_utf8(const char* data, gdv_int32
data_len) {
return static_cast<gdv_int32>(data[0]);
}
+// Returns the ASCII character having the binary equivalent to A.
+// If A is larger than 256 the result is equivalent to chr(A % 256).
+GANDIVA_EXPORT
+const char* chr_int32(gdv_int64 context, gdv_int32 in, gdv_int32* out_len) {
+ in = in % 256;
Review comment:
moved
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]