This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 37616a8da5 GH-39328: [Java] Make default getConsumer public (#39329)
37616a8da5 is described below

commit 37616a8da57e4d98c82e8213ba1999cff4354334
Author: Diego Fernández Giraldo <[email protected]>
AuthorDate: Wed Dec 20 13:14:11 2023 -0700

    GH-39328: [Java] Make default getConsumer public (#39329)
    
    
    
    ### Rationale for this change
    
    This can be useful for people implementing their own getConsumer
    
    ### What changes are included in this PR?
    
    Make the default getConsumer public.
    
    ### Are these changes tested?
    
    N/A
    
    ### Are there any user-facing changes?
    
    Users can now call JdbcToArrowUtils.getConsumer
    
    * Closes: #39328
    
    Authored-by: Diego Fernandez <[email protected]>
    Signed-off-by: David Li <[email protected]>
---
 .../org/apache/arrow/adapter/jdbc/JdbcToArrowUtils.java     | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrowUtils.java
 
b/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrowUtils.java
index f8a13b93b1..b66e133785 100644
--- 
a/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrowUtils.java
+++ 
b/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrowUtils.java
@@ -430,7 +430,18 @@ public class JdbcToArrowUtils {
     }
   }
 
-  static JdbcConsumer getConsumer(ArrowType arrowType, int columnIndex, 
boolean nullable,
+  /**
+   * Default function used for JdbcConsumerFactory. This function gets a 
JdbcConsumer for the
+   * given column based on the Arrow type and provided vector.
+   *
+   * @param arrowType   Arrow type for the column.
+   * @param columnIndex Column index to fetch from the ResultSet
+   * @param nullable    Whether the value is nullable or not
+   * @param vector      Vector to store the consumed value
+   * @param config      Associated JdbcToArrowConfig, used mainly for the 
Calendar.
+   * @return {@link JdbcConsumer}
+   */
+  public static JdbcConsumer getConsumer(ArrowType arrowType, int columnIndex, 
boolean nullable,
       FieldVector vector, JdbcToArrowConfig config) {
     final Calendar calendar = config.getCalendar();
 

Reply via email to