[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-20 Thread ASF GitHub Bot (JIRA)

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

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

siddharthteotia commented on issue #1325: ARROW-1826: [JAVA] Avoid branching in 
copyFrom for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325#issuecomment-345800457
 
 
   I was late by a few milli seconds I guess :)


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
> Fix For: 0.8.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-20 Thread ASF GitHub Bot (JIRA)

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

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

wesm commented on issue #1325: ARROW-1826: [JAVA] Avoid branching in copyFrom 
for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325#issuecomment-345800163
 
 
   Merging in case Sidd hasn't got the Gitbox stuff set up yet


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
> Fix For: 0.8.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-20 Thread ASF GitHub Bot (JIRA)

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

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

siddharthteotia commented on issue #1325: ARROW-1826: [JAVA] Avoid branching in 
copyFrom for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325#issuecomment-345800395
 
 
   @wesm , just finished that setup
   


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
> Fix For: 0.8.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-20 Thread ASF GitHub Bot (JIRA)

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

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

wesm closed pull request #1325: ARROW-1826: [JAVA] Avoid branching in copyFrom 
for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableBigIntVector.java 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableBigIntVector.java
index eca6592c5..8d44c92e4 100644
--- 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableBigIntVector.java
+++ 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableBigIntVector.java
@@ -137,11 +137,9 @@ public Long getObject(int index) {
* @param from source vector
*/
   public void copyFrom(int fromIndex, int thisIndex, NullableBigIntVector 
from) {
-if (from.isSet(fromIndex) != 0) {
-  set(thisIndex, from.get(fromIndex));
-} else {
-  BitVectorHelper.setValidityBit(validityBuffer, thisIndex, 0);
-}
+BitVectorHelper.setValidityBit(validityBuffer, thisIndex, 
from.isSet(fromIndex));
+final long value = from.valueBuffer.getLong(fromIndex * TYPE_WIDTH);
+valueBuffer.setLong(thisIndex * TYPE_WIDTH, value);
   }
 
   /**
diff --git 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableBitVector.java 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableBitVector.java
index bd363f5b7..086331e13 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/NullableBitVector.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/NullableBitVector.java
@@ -286,11 +286,8 @@ public Boolean getObject(int index) {
* @param from  source vector
*/
   public void copyFrom(int fromIndex, int thisIndex, NullableBitVector from) {
-if (from.isSet(fromIndex) != 0) {
-  set(thisIndex, from.get(fromIndex));
-} else {
-  BitVectorHelper.setValidityBit(validityBuffer, thisIndex, 0);
-}
+BitVectorHelper.setValidityBit(validityBuffer, thisIndex, 
from.isSet(fromIndex));
+BitVectorHelper.setValidityBit(valueBuffer, thisIndex, 
from.getBit(fromIndex));
   }
 
   /**
diff --git 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableDateDayVector.java 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableDateDayVector.java
index c5ddc9e87..bb14d1ac0 100644
--- 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableDateDayVector.java
+++ 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableDateDayVector.java
@@ -139,11 +139,9 @@ public Integer getObject(int index) {
* @param from source vector
*/
   public void copyFrom(int fromIndex, int thisIndex, NullableDateDayVector 
from) {
-if (from.isSet(fromIndex) != 0) {
-  set(thisIndex, from.get(fromIndex));
-} else {
-  BitVectorHelper.setValidityBit(validityBuffer, thisIndex, 0);
-}
+BitVectorHelper.setValidityBit(validityBuffer, thisIndex, 
from.isSet(fromIndex));
+final int value = from.valueBuffer.getInt(fromIndex * TYPE_WIDTH);
+valueBuffer.setInt(thisIndex * TYPE_WIDTH, value);
   }
 
   /**
diff --git 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableDateMilliVector.java
 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableDateMilliVector.java
index 7e37055da..97205c318 100644
--- 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableDateMilliVector.java
+++ 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableDateMilliVector.java
@@ -144,11 +144,9 @@ public LocalDateTime getObject(int index) {
* @param from source vector
*/
   public void copyFrom(int fromIndex, int thisIndex, NullableDateMilliVector 
from) {
-if (from.isSet(fromIndex) != 0) {
-  set(thisIndex, from.get(fromIndex));
-} else {
-  BitVectorHelper.setValidityBit(validityBuffer, thisIndex, 0);
-}
+BitVectorHelper.setValidityBit(validityBuffer, thisIndex, 
from.isSet(fromIndex));
+final long value = from.valueBuffer.getLong(fromIndex * TYPE_WIDTH);
+valueBuffer.setLong(thisIndex * TYPE_WIDTH, value);
   }
 
   /**
diff --git 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableDecimalVector.java 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableDecimalVector.java
index dcc551094..5d2782a4c 100644
--- 
a/java/vector/src/main/java/org/apache/arrow/vector/NullableDecimalVector.java
+++ 
b/java/vector/src/main/java/org/apache/arrow/vector/NullableDecimalVector.java
@@ -151,13 +151,9 @@ public BigDecimal getObject(int index) {
* @param from source vector
*/
   public void copyFrom(int fromIndex, int thisIndex, 

[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-20 Thread ASF GitHub Bot (JIRA)

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

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

BryanCutler commented on issue #1325: ARROW-1826: [JAVA] Avoid branching in 
copyFrom for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325#issuecomment-345790467
 
 
   +1


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-20 Thread ASF GitHub Bot (JIRA)

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

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

jacques-n commented on issue #1325: ARROW-1826: [JAVA] Avoid branching in 
copyFrom for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325#issuecomment-345785472
 
 
   Looks good +1
   
   @siddharthteotia, can you merge this? No need to rely on Wes to do these 
things.


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-20 Thread ASF GitHub Bot (JIRA)

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

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

siddharthteotia commented on issue #1325: ARROW-1826: [JAVA] Avoid branching in 
copyFrom for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325#issuecomment-345783869
 
 
   This can be merged. Added unit tests as necessary.


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-16 Thread ASF GitHub Bot (JIRA)

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

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

jacques-n commented on issue #1325: ARROW-1826: [JAVA] Avoid branching in 
copyFrom for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325#issuecomment-345062181
 
 
   lgtm. Agree that unit test would be good if we don't already have them.


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-16 Thread ASF GitHub Bot (JIRA)

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

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

icexelloss commented on issue #1325: ARROW-1826: [JAVA] Avoid branching in 
copyFrom for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325#issuecomment-345011489
 
 
   Looks good. Please add unit test.


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ARROW-1826) [JAVA] Avoid branching at cell level (copyFrom)

2017-11-16 Thread ASF GitHub Bot (JIRA)

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

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

siddharthteotia opened a new pull request #1325: ARROW-1826: [JAVA] Avoid 
branching in copyFrom for fixed width scalars
URL: https://github.com/apache/arrow/pull/1325
 
 
   cc @jacques-n , @BryanCutler , @icexelloss 
   
   Note: there was no performance regression or different behavior introduced 
as part of refactor patches.
   
   This is something I had noticed in the old code during refactoring but lost 
track of it. copyFrom function for fixed width scalars does a double check if 
the cell in the source vector is NULL or not. The old code used to do the same.
   
   There is a straightforward way to avoid double check but the new changes 
avoid branch all-together; since it is fine to copy garbage from source vector 
as long as the validity bit is copied correctly to indicate NULL or non-NULL 
value in the target cell.
   
   Will add unit tests. 


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


> [JAVA] Avoid branching at cell level (copyFrom)
> ---
>
> Key: ARROW-1826
> URL: https://issues.apache.org/jira/browse/ARROW-1826
> Project: Apache Arrow
>  Issue Type: Improvement
>Reporter: Siddharth Teotia
>Assignee: Siddharth Teotia
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)