You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/10/19 12:41:22 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #34154: [SPARK-37047][SQL] Add lpad and rpad functions for binary strings

cloud-fan commented on a change in pull request #34154:
URL: https://github.com/apache/spark/pull/34154#discussion_r731822261



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java
##########
@@ -101,4 +101,82 @@ public static long getPrefix(byte[] bytes) {
     }
     return result;
   }
+
+  // Helper method for implementing `lpad` and `rpad`.
+  // If the padding pattern's length is 0, return the first `len` bytes of the input
+  // binary string if it longer than `len` bytes, or a copy of the binary string, otherwise.
+  protected static byte[] padWithEmptyPattern(byte[] bytes, int len) {

Review comment:
       ```suggestion
     private static byte[] padWithEmptyPattern(byte[] bytes, int len) {
   ```




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org