[ 
https://issues.apache.org/jira/browse/ARROW-1780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434161#comment-16434161
 ] 

ASF GitHub Bot commented on ARROW-1780:
---------------------------------------

laurentgo commented on a change in pull request #1759: ARROW-1780 - [WIP] JDBC 
Adapter to convert Relational Data objects to Arrow Data Format Vector Objects
URL: https://github.com/apache/arrow/pull/1759#discussion_r180253135
 
 

 ##########
 File path: 
java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrowUtils.java
 ##########
 @@ -200,144 +226,206 @@ public static void jdbcToArrowVectors(ResultSet rs, 
VectorSchemaRoot root) throw
                 switch (rsmd.getColumnType(i)) {
                     case Types.BOOLEAN:
                     case Types.BIT:
-                        BitVector bitVector = (BitVector) 
root.getVector(columnName);
-                        bitVector.setSafe(rowCount, rs.getBoolean(i)? 1: 0);
-                        bitVector.setValueCount(rowCount + 1);
+                        updateVector((BitVector)root.getVector(columnName),
+                                rs.getBoolean(i), rowCount);
                         break;
                     case Types.TINYINT:
-                        TinyIntVector tinyIntVector = 
(TinyIntVector)root.getVector(columnName);
-                        tinyIntVector.setSafe(rowCount, rs.getInt(i));
-                        tinyIntVector.setValueCount(rowCount + 1);
+                        updateVector((TinyIntVector)root.getVector(columnName),
+                                rs.getInt(i), rowCount);
                         break;
                     case Types.SMALLINT:
-                        SmallIntVector smallIntVector = 
(SmallIntVector)root.getVector(columnName);
-                        smallIntVector.setSafe(rowCount, rs.getInt(i));
-                        smallIntVector.setValueCount(rowCount + 1);
+                        
updateVector((SmallIntVector)root.getVector(columnName),
+                                rs.getInt(i), rowCount);
                         break;
                     case Types.INTEGER:
-                        IntVector intVector = 
(IntVector)root.getVector(columnName);
-                        intVector.setSafe(rowCount, rs.getInt(i));
-                        intVector.setValueCount(rowCount + 1);
+                        updateVector((IntVector)root.getVector(columnName),
+                                rs.getInt(i), rowCount);
                         break;
                     case Types.BIGINT:
-                        BigIntVector bigIntVector = 
(BigIntVector)root.getVector(columnName);
-                        bigIntVector.setSafe(rowCount, rs.getInt(i));
-                        bigIntVector.setValueCount(rowCount + 1);
+                        updateVector((BigIntVector)root.getVector(columnName),
+                                rs.getInt(i), rowCount);
 
 Review comment:
   if bigint is a 64bits integer, it should probably use rs.getLong() (maybe 
have unit tests with large values, both positive and negative?)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> JDBC Adapter for Apache Arrow
> -----------------------------
>
>                 Key: ARROW-1780
>                 URL: https://issues.apache.org/jira/browse/ARROW-1780
>             Project: Apache Arrow
>          Issue Type: New Feature
>            Reporter: Atul Dambalkar
>            Assignee: Atul Dambalkar
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.10.0
>
>
> At a high level the JDBC Adapter will allow upstream apps to query RDBMS data 
> over JDBC and get the JDBC objects converted to Arrow objects/structures. The 
> upstream utility can then work with Arrow objects/structures with usual 
> performance benefits. The utility will be very much similar to C++ 
> implementation of "Convert a vector of row-wise data into an Arrow table" as 
> described here - 
> https://arrow.apache.org/docs/cpp/md_tutorials_row_wise_conversion.html
> The utility will read data from RDBMS and covert the data into Arrow 
> objects/structures. So from that perspective this will Read data from RDBMS, 
> If the utility can push Arrow objects to RDBMS is something need to be 
> discussed and will be out of scope for this utility for now. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to