You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jduo (via GitHub)" <gi...@apache.org> on 2023/09/26 18:21:10 UTC

[GitHub] [arrow] jduo commented on a diff in pull request #37883: GH-37705: [Java] Extra input methods for VarChar writers

jduo commented on code in PR #37883:
URL: https://github.com/apache/arrow/pull/37883#discussion_r1337616910


##########
java/vector/src/main/codegen/templates/ComplexWriters.java:
##########
@@ -120,11 +120,18 @@ public void write(Nullable${minor.class}Holder h) {
   }
   </#if>
 
-  <#if minor.class == "VarChar">
+  <#if minor.class?ends_with("VarChar")>
+  @Override
   public void write${minor.class}(${friendlyType} value) {
     vector.setSafe(idx(), value);
     vector.setValueCount(idx()+1);
   }
+
+  @Override
+  public void write${minor.class}(String value) {
+    vector.setSafe(idx(), new Text(value));

Review Comment:
   That makes sense. It looks like it'd avoid an allocation if write was called with strings of decreasing size.



-- 
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: github-unsubscribe@arrow.apache.org

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