[GitHub] [incubator-livy] vanzin commented on a change in pull request #162: [LIVY-572] Avoid usage of spark classes in ColumnBuffer

2019-03-26 Thread GitBox
vanzin commented on a change in pull request #162: [LIVY-572] Avoid usage of 
spark classes in ColumnBuffer
URL: https://github.com/apache/incubator-livy/pull/162#discussion_r269165870
 
 

 ##
 File path: 
thriftserver/session/src/main/java/org/apache/livy/thriftserver/session/ResultSet.java
 ##
 @@ -43,7 +63,13 @@ public void addRow(Object[] fields) {
 }
 
 for (int i = 0; i < fields.length; i++) {
-  columns[i].add(fields[i]);
+  Object value;
+  if (columnIsString[i]) {
 
 Review comment:
   Using `==` there's actually no more overhead at all. In fact, if you look at 
CPU caches and things like that it's probably faster since there's less risk of 
a cache miss...


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-livy] vanzin commented on a change in pull request #162: [LIVY-572] Avoid usage of spark classes in ColumnBuffer

2019-03-25 Thread GitBox
vanzin commented on a change in pull request #162: [LIVY-572] Avoid usage of 
spark classes in ColumnBuffer
URL: https://github.com/apache/incubator-livy/pull/162#discussion_r268902862
 
 

 ##
 File path: 
thriftserver/session/src/main/java/org/apache/livy/thriftserver/session/ResultSet.java
 ##
 @@ -43,7 +63,13 @@ public void addRow(Object[] fields) {
 }
 
 for (int i = 0; i < fields.length; i++) {
-  columns[i].add(fields[i]);
+  Object value;
+  if (columnIsString[i]) {
 
 Review comment:
   Checking `columns[i].getType().equals(DataType.STRING)` here avoids the 
extra boolean array.
   
   (It's also an enum so you could use `==`.)


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services