phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-1516 Add RAND() built-in function
Date Sat, 24 Jan 2015 05:14:39 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.0 5a988cb82 -> 02fc354d6


PHOENIX-1516 Add RAND() built-in function


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/02fc354d
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/02fc354d
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/02fc354d

Branch: refs/heads/4.0
Commit: 02fc354d68ee85bcf71459f721e4873c0e75f852
Parents: 5a988cb
Author: James Taylor <jtaylor@salesforce.com>
Authored: Fri Jan 23 21:13:25 2015 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Fri Jan 23 21:14:31 2015 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/compile/RowProjector.java  | 5 ++---
 .../main/java/org/apache/phoenix/compile/UpsertCompiler.java    | 2 +-
 .../java/org/apache/phoenix/mapreduce/PhoenixRecordReader.java  | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/02fc354d/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java
index 2833962..364ebd6 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java
@@ -42,7 +42,7 @@ import com.google.common.collect.ListMultimap;
  * 
  * @since 0.1
  */
-public class RowProjector implements Cloneable {
+public class RowProjector {
     public static final RowProjector EMPTY_PROJECTOR = new RowProjector(Collections.<ColumnProjector>emptyList(),0,
true);
 
     private final List<? extends ColumnProjector> columnProjectors;
@@ -93,8 +93,7 @@ public class RowProjector implements Cloneable {
         this.cloneRequired = hasPerInvocationExpression;
     }
 
-    @Override
-    public RowProjector clone() {
+    public RowProjector cloneIfNecessary() {
         if (!cloneRequired) {
             return this;
         }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/02fc354d/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
index e0ec3fd..d534d50 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
@@ -192,7 +192,7 @@ public class UpsertCompiler {
             PhoenixStatement statement = new PhoenixStatement(connection);
             // Clone the row projector as it's not thread safe and would be used simultaneously
by
             // multiple threads otherwise.
-            return upsertSelect(statement, tableRef, projector.clone(), iterator, columnIndexes,
pkSlotIndexes);
+            return upsertSelect(statement, tableRef, projector.cloneIfNecessary(), iterator,
columnIndexes, pkSlotIndexes);
         }
         
         public void setRowProjector(RowProjector projector) {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/02fc354d/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordReader.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordReader.java
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordReader.java
index b8eb116..2074658 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordReader.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordReader.java
@@ -111,7 +111,7 @@ public class PhoenixRecordReader<T extends DBWritable> extends RecordReader<Null
             this.resultIterator = iterator;
             // Clone the row projector as it's not thread safe and would be used simultaneously
by
             // multiple threads otherwise.
-            this.resultSet = new PhoenixResultSet(this.resultIterator, queryPlan.getProjector().clone(),queryPlan.getContext().getStatement());
+            this.resultSet = new PhoenixResultSet(this.resultIterator, queryPlan.getProjector().cloneIfNecessary(),queryPlan.getContext().getStatement());
         } catch (SQLException e) {
             LOG.error(String.format(" Error [%s] initializing PhoenixRecordReader. ",e.getMessage()));
             Throwables.propagate(e);


Mime
View raw message