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

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

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


##########
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:
   It's small, but is it worth caching the Text object in the writer implementation? It seems from the Text API that that was the intent.



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