phoenix git commit: PHOENIX-2659 Incorrect argument parsing and bad command for queryserver.py (Josh Elser)

2016-02-12 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 980eb36e2 -> 0c1fd3ad5


PHOENIX-2659 Incorrect argument parsing and bad command for
 queryserver.py (Josh Elser)


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

Branch: refs/heads/master
Commit: 0c1fd3ad503207079bd20fc0d04c0409280c305b
Parents: 980eb36
Author: James Taylor 
Authored: Fri Feb 12 10:57:23 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 10:57:23 2016 -0800

--
 bin/queryserver.py | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0c1fd3ad/bin/queryserver.py
--
diff --git a/bin/queryserver.py b/bin/queryserver.py
index d4228b3..c80e629 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -55,14 +55,19 @@ if len(args) > 1:
 command = 'stop'
 elif args[1] == 'makeWinServiceDesc':
 command = 'makeWinServiceDesc'
+
 if command:
+# Pull off queryserver.py and the command
 args = args[2:]
+else:
+# Just pull off queryserver.py
+args = args[1:]
 
 if os.name == 'nt':
-args = subprocess.list2cmdline(args[1:])
+args = subprocess.list2cmdline(args)
 else:
 import pipes# pipes module isn't available on Windows
-args = " ".join([pipes.quote(v) for v in args[1:]])
+args = " ".join([pipes.quote(v) for v in args])
 
 # HBase configuration folder path (where hbase-site.xml reside) for
 # HBase/Phoenix client side property override
@@ -119,7 +124,9 @@ else:
 
 #" -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n " 
+ \
 #" -XX:+UnlockCommercialFeatures -XX:+FlightRecorder 
-XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true" + \
-java_cmd = '%(java)s $PHOENIX_OPTS -cp ' + hbase_config_path + os.pathsep + 
hadoop_config_path + os.pathsep + \
+
+# The command is run through subprocess so environment variables are 
automatically inherited
+java_cmd = '%(java)s -cp ' + hbase_config_path + os.pathsep + 
hadoop_config_path + os.pathsep + \
 phoenix_utils.phoenix_queryserver_jar + os.pathsep + 
phoenix_utils.phoenix_client_jar + \
 " -Dproc_phoenixserver" + \
 " -Dlog4j.configuration=file:" + os.path.join(phoenix_utils.current_dir, 
"log4j.properties") + \
@@ -201,5 +208,6 @@ elif command == 'stop':
 else:
 # run in the foreground using defaults from log4j.properties
 cmd = java_cmd % {'java': java, 'root_logger': 'INFO,console', 'log_dir': 
'.', 'log_file': 'psql.log'}
+# Because shell=True is not set, we don't have to alter the environment
 child = subprocess.Popen(cmd.split())
 sys.exit(child.wait())



[1/2] phoenix git commit: PHOENIX-2657 Transactionally deleted cells become visible after few hours

2016-02-12 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 421ad309b -> fd757a055


PHOENIX-2657 Transactionally deleted cells become visible after few hours


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 9d3e8efc5ee54bfdc114843308300d372a74ae00
Parents: 421ad30
Author: James Taylor 
Authored: Fri Feb 12 09:38:43 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 11:05:26 2016 -0800

--
 .../apache/phoenix/filter/SkipScanFilter.java   | 47 +---
 .../phoenix/index/PhoenixIndexBuilder.java  |  4 +-
 .../index/PhoenixTransactionalIndexer.java  |  5 ++-
 3 files changed, 38 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d3e8efc/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java 
b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
index 00320ce..c966d91 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
@@ -43,8 +43,6 @@ import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ScanUtil.BytesComparator;
 import org.apache.phoenix.util.SchemaUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Objects;
 import com.google.common.collect.Lists;
@@ -63,8 +61,6 @@ import com.google.common.hash.Hashing;
  * @since 0.1
  */
 public class SkipScanFilter extends FilterBase implements Writable {
-private static final Logger logger = 
LoggerFactory.getLogger(SkipScanFilter.class);
-
 private enum Terminate {AT, AFTER};
 // Conjunctive normal form of or-ed ranges or point lookups
 private List slots;
@@ -72,6 +68,7 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 private int[] slotSpan;
 // schema of the row key
 private RowKeySchema schema;
+private boolean includeMultipleVersions;
 // current position for each slot
 private int[] position;
 // buffer used for skip hint
@@ -94,19 +91,27 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 public SkipScanFilter() {
 }
 
+public SkipScanFilter(SkipScanFilter filter, boolean 
includeMultipleVersions) {
+this(filter.slots, filter.slotSpan, filter.schema, 
includeMultipleVersions);
+}
+
 public SkipScanFilter(List slots, RowKeySchema schema) {
 this(slots, ScanUtil.getDefaultSlotSpans(slots.size()), schema);
 }
 
 public SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema) {
-init(slots, slotSpan, schema);
+this(slots, slotSpan, schema, false);
+}
+
+private SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema, boolean includeMultipleVersions) {
+init(slots, slotSpan, schema, includeMultipleVersions);
 }
 
 public void setOffset(int offset) {
 this.offset = offset;
 }
 
-private void init(List slots, int[] slotSpan, RowKeySchema 
schema) {
+private void init(List slots, int[] slotSpan, RowKeySchema 
schema, boolean includeMultipleVersions) {
 for (List ranges : slots) {
 if (ranges.isEmpty()) {
 throw new IllegalStateException();
@@ -117,9 +122,10 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 this.schema = schema;
 this.maxKeyLength = SchemaUtil.getMaxKeyLength(schema, slots);
 this.position = new int[slots.size()];
-startKey = new byte[maxKeyLength];
-endKey = new byte[maxKeyLength];
-endKeyLength = 0;
+this.startKey = new byte[maxKeyLength];
+this.endKey = new byte[maxKeyLength];
+this.endKeyLength = 0;
+this.includeMultipleVersions = includeMultipleVersions;
 }
 
 // Exposed for testing.
@@ -345,15 +351,20 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 return i;
 }
 
+private ReturnCode getIncludeReturnCode() {
+return includeMultipleVersions ? ReturnCode.INCLUDE : 
ReturnCode.INCLUDE_AND_NEXT_COL;
+}
+
 @edu.umd.cs.findbugs.annotations.SuppressWarnings(
 value="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT", 
 justification="Assignment designed to work this 

[2/2] phoenix git commit: PHOENIX-2659 Incorrect argument parsing and bad command for queryserver.py (Josh Elser)

2016-02-12 Thread jamestaylor
PHOENIX-2659 Incorrect argument parsing and bad command for
 queryserver.py (Josh Elser)


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

Branch: refs/heads/4.x-HBase-1.0
Commit: fd757a055670592ae89eb7fcac6bc128c87131c4
Parents: 9d3e8ef
Author: James Taylor 
Authored: Fri Feb 12 10:57:23 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 11:05:42 2016 -0800

--
 bin/queryserver.py | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/fd757a05/bin/queryserver.py
--
diff --git a/bin/queryserver.py b/bin/queryserver.py
index d4228b3..c80e629 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -55,14 +55,19 @@ if len(args) > 1:
 command = 'stop'
 elif args[1] == 'makeWinServiceDesc':
 command = 'makeWinServiceDesc'
+
 if command:
+# Pull off queryserver.py and the command
 args = args[2:]
+else:
+# Just pull off queryserver.py
+args = args[1:]
 
 if os.name == 'nt':
-args = subprocess.list2cmdline(args[1:])
+args = subprocess.list2cmdline(args)
 else:
 import pipes# pipes module isn't available on Windows
-args = " ".join([pipes.quote(v) for v in args[1:]])
+args = " ".join([pipes.quote(v) for v in args])
 
 # HBase configuration folder path (where hbase-site.xml reside) for
 # HBase/Phoenix client side property override
@@ -119,7 +124,9 @@ else:
 
 #" -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n " 
+ \
 #" -XX:+UnlockCommercialFeatures -XX:+FlightRecorder 
-XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true" + \
-java_cmd = '%(java)s $PHOENIX_OPTS -cp ' + hbase_config_path + os.pathsep + 
hadoop_config_path + os.pathsep + \
+
+# The command is run through subprocess so environment variables are 
automatically inherited
+java_cmd = '%(java)s -cp ' + hbase_config_path + os.pathsep + 
hadoop_config_path + os.pathsep + \
 phoenix_utils.phoenix_queryserver_jar + os.pathsep + 
phoenix_utils.phoenix_client_jar + \
 " -Dproc_phoenixserver" + \
 " -Dlog4j.configuration=file:" + os.path.join(phoenix_utils.current_dir, 
"log4j.properties") + \
@@ -201,5 +208,6 @@ elif command == 'stop':
 else:
 # run in the foreground using defaults from log4j.properties
 cmd = java_cmd % {'java': java, 'root_logger': 'INFO,console', 'log_dir': 
'.', 'log_file': 'psql.log'}
+# Because shell=True is not set, we don't have to alter the environment
 child = subprocess.Popen(cmd.split())
 sys.exit(child.wait())



phoenix git commit: PHOENIX-2657 Transactionally deleted cells become visible after few hours

2016-02-12 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 0c21539cc -> 980eb36e2


PHOENIX-2657 Transactionally deleted cells become visible after few hours


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

Branch: refs/heads/master
Commit: 980eb36e251e917343d1376b2ac6f8c57d223c35
Parents: 0c21539
Author: James Taylor 
Authored: Fri Feb 12 09:38:43 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 09:38:43 2016 -0800

--
 .../apache/phoenix/filter/SkipScanFilter.java   | 47 +---
 .../phoenix/index/PhoenixIndexBuilder.java  |  4 +-
 .../index/PhoenixTransactionalIndexer.java  |  5 ++-
 3 files changed, 38 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/980eb36e/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java 
b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
index 00320ce..c966d91 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
@@ -43,8 +43,6 @@ import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ScanUtil.BytesComparator;
 import org.apache.phoenix.util.SchemaUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Objects;
 import com.google.common.collect.Lists;
@@ -63,8 +61,6 @@ import com.google.common.hash.Hashing;
  * @since 0.1
  */
 public class SkipScanFilter extends FilterBase implements Writable {
-private static final Logger logger = 
LoggerFactory.getLogger(SkipScanFilter.class);
-
 private enum Terminate {AT, AFTER};
 // Conjunctive normal form of or-ed ranges or point lookups
 private List slots;
@@ -72,6 +68,7 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 private int[] slotSpan;
 // schema of the row key
 private RowKeySchema schema;
+private boolean includeMultipleVersions;
 // current position for each slot
 private int[] position;
 // buffer used for skip hint
@@ -94,19 +91,27 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 public SkipScanFilter() {
 }
 
+public SkipScanFilter(SkipScanFilter filter, boolean 
includeMultipleVersions) {
+this(filter.slots, filter.slotSpan, filter.schema, 
includeMultipleVersions);
+}
+
 public SkipScanFilter(List slots, RowKeySchema schema) {
 this(slots, ScanUtil.getDefaultSlotSpans(slots.size()), schema);
 }
 
 public SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema) {
-init(slots, slotSpan, schema);
+this(slots, slotSpan, schema, false);
+}
+
+private SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema, boolean includeMultipleVersions) {
+init(slots, slotSpan, schema, includeMultipleVersions);
 }
 
 public void setOffset(int offset) {
 this.offset = offset;
 }
 
-private void init(List slots, int[] slotSpan, RowKeySchema 
schema) {
+private void init(List slots, int[] slotSpan, RowKeySchema 
schema, boolean includeMultipleVersions) {
 for (List ranges : slots) {
 if (ranges.isEmpty()) {
 throw new IllegalStateException();
@@ -117,9 +122,10 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 this.schema = schema;
 this.maxKeyLength = SchemaUtil.getMaxKeyLength(schema, slots);
 this.position = new int[slots.size()];
-startKey = new byte[maxKeyLength];
-endKey = new byte[maxKeyLength];
-endKeyLength = 0;
+this.startKey = new byte[maxKeyLength];
+this.endKey = new byte[maxKeyLength];
+this.endKeyLength = 0;
+this.includeMultipleVersions = includeMultipleVersions;
 }
 
 // Exposed for testing.
@@ -345,15 +351,20 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 return i;
 }
 
+private ReturnCode getIncludeReturnCode() {
+return includeMultipleVersions ? ReturnCode.INCLUDE : 
ReturnCode.INCLUDE_AND_NEXT_COL;
+}
+
 @edu.umd.cs.findbugs.annotations.SuppressWarnings(
 value="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT", 
 justification="Assignment designed to work this way.")
 

[1/2] phoenix git commit: PHOENIX-2090 Refine PhoenixTableScan.computeSelfCost() when scanRanges is available

2016-02-12 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/calcite 751d134be -> 8b68b1c4e


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8b68b1c4/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java
index f200a24..3f0f754 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java
@@ -55,62 +55,71 @@ public class CalciteIndexIT extends BaseCalciteIT {
 initATableValues(getOrganizationId(), null, url);
 initSaltedTables(index);
 initMultiTenantTables(index);
-final Connection connection = DriverManager.getConnection(url);
+Connection connection = DriverManager.getConnection(url);
 connection.createStatement().execute("CREATE " + index + " IF NOT 
EXISTS IDX1 ON aTable (a_string) INCLUDE (b_string, x_integer)");
 connection.createStatement().execute("CREATE " + index + " IF NOT 
EXISTS IDX2 ON aTable (b_string) INCLUDE (a_string, y_integer)");
 connection.createStatement().execute("CREATE " + index + " IF NOT 
EXISTS IDX_FULL ON aTable (b_string) INCLUDE (a_string, a_integer, a_date, 
a_time, a_timestamp, x_decimal, x_long, x_integer, y_integer, a_byte, a_short, 
a_float, a_double, a_unsigned_float, a_unsigned_double)");
 connection.createStatement().execute("UPDATE STATISTICS ATABLE");
+connection.createStatement().execute("UPDATE STATISTICS " + 
NOSALT_TABLE_NAME);
 connection.createStatement().execute("UPDATE STATISTICS " + 
SALTED_TABLE_NAME);
-connection.createStatement().execute("UPDATE STATISTICS IDX_" + 
SALTED_TABLE_NAME);
-connection.createStatement().execute("UPDATE STATISTICS IDX1");
-connection.createStatement().execute("UPDATE STATISTICS IDX2");
-connection.createStatement().execute("UPDATE STATISTICS IDX_FULL");
+connection.createStatement().execute("UPDATE STATISTICS " + 
MULTI_TENANT_TABLE);
+connection.close();
+
+Properties props = new Properties();
+props.setProperty("TenantId", "10");
+connection = DriverManager.getConnection(url, props);
+connection.createStatement().execute("UPDATE STATISTICS " + 
MULTI_TENANT_VIEW1);
+connection.close();
+
+props.setProperty("TenantId", "20");
+connection = DriverManager.getConnection(url, props);
+connection.createStatement().execute("UPDATE STATISTICS " + 
MULTI_TENANT_VIEW2);
 connection.close();
 }
 
 @Test public void testIndex() throws Exception {
-start(true).sql("select * from aTable where b_string = 'b'")
+start(true, 1000f).sql("select * from aTable where b_string = 'b'")
 .explainIs("PhoenixToEnumerableConverter\n" +
"  PhoenixServerProject(ORGANIZATION_ID=[$1], 
ENTITY_ID=[$2], A_STRING=[$3], B_STRING=[$0], A_INTEGER=[$4], A_DATE=[$5], 
A_TIME=[$6], A_TIMESTAMP=[$7], X_DECIMAL=[$8], X_LONG=[$9], X_INTEGER=[$10], 
Y_INTEGER=[$11], A_BYTE=[$12], A_SHORT=[$13], A_FLOAT=[$14], A_DOUBLE=[$15], 
A_UNSIGNED_FLOAT=[$16], A_UNSIGNED_DOUBLE=[$17])\n" +
"PhoenixTableScan(table=[[phoenix, IDX_FULL]], 
filter=[=($0, 'b')])\n")
 .close();
-start(true).sql("select x_integer from aTable")
+start(true, 1000f).sql("select x_integer from aTable")
 .explainIs("PhoenixToEnumerableConverter\n" +
"  PhoenixServerProject(X_INTEGER=[$4])\n" +
"PhoenixTableScan(table=[[phoenix, IDX1]])\n")
 .close();
-start(true).sql("select a_string from aTable order by a_string")
+start(true, 1000f).sql("select a_string from aTable order by a_string")
 .explainIs("PhoenixToEnumerableConverter\n" +
"  PhoenixServerProject(A_STRING=[$0])\n" +
"PhoenixTableScan(table=[[phoenix, IDX1]], 
scanOrder=[FORWARD])\n")
 .close();
-start(true).sql("select a_string from aTable order by organization_id")
+start(true, 1000f).sql("select a_string from aTable order by 
organization_id")
 .explainIs("PhoenixToEnumerableConverter\n" +
"  PhoenixServerProject(A_STRING=[$2], 
ORGANIZATION_ID=[$0])\n" +
"PhoenixTableScan(table=[[phoenix, ATABLE]], 
scanOrder=[FORWARD])\n")
 .close();
-start(true).sql("select a_integer from aTable order by a_string")
+start(true, 1000f).sql("select a_integer from aTable order by 
a_string")
 .explainIs("PhoenixToEnumerableConverter\n" +
"  PhoenixServerSort(sort0=[$1], 

[2/2] phoenix git commit: PHOENIX-2090 Refine PhoenixTableScan.computeSelfCost() when scanRanges is available

2016-02-12 Thread maryannxue
PHOENIX-2090 Refine PhoenixTableScan.computeSelfCost() when scanRanges is 
available


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

Branch: refs/heads/calcite
Commit: 8b68b1c4e8a68ac70c058e9d568d98af95073fc9
Parents: 751d134
Author: maryannxue 
Authored: Fri Feb 12 13:59:54 2016 -0500
Committer: maryannxue 
Committed: Fri Feb 12 13:59:54 2016 -0500

--
 .../apache/phoenix/calcite/BaseCalciteIT.java   | 102 
 .../org/apache/phoenix/calcite/CalciteIT.java   | 234 ++-
 .../apache/phoenix/calcite/CalciteIndexIT.java  | 155 ++--
 .../apache/phoenix/calcite/PhoenixTable.java|  68 +-
 .../calcite/metadata/PhoenixRelMdSize.java  |  75 ++
 .../metadata/PhoenixRelMetadataProvider.java|   1 +
 .../calcite/rel/PhoenixAbstractSort.java|  16 +-
 .../calcite/rel/PhoenixCompactClientSort.java   |   2 +-
 .../apache/phoenix/calcite/rel/PhoenixRel.java  |   7 +-
 .../phoenix/calcite/rel/PhoenixServerJoin.java  |   4 +-
 .../calcite/rel/PhoenixServerSemiJoin.java  |   4 +-
 .../phoenix/calcite/rel/PhoenixTableScan.java   |  86 +--
 .../coprocessor/MetaDataEndpointImpl.java   |  20 +-
 .../phoenix/schema/stats/StatisticsUtil.java|  18 +-
 .../phoenix/schema/stats/StatisticsWriter.java  |   2 +-
 15 files changed, 510 insertions(+), 284 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8b68b1c4/phoenix-core/src/it/java/org/apache/phoenix/calcite/BaseCalciteIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/calcite/BaseCalciteIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/calcite/BaseCalciteIT.java
index 9afddab..35c46e7 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/calcite/BaseCalciteIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/calcite/BaseCalciteIT.java
@@ -32,6 +32,7 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.text.DecimalFormat;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -39,6 +40,7 @@ import java.util.Properties;
 
 import org.apache.calcite.avatica.util.ArrayImpl;
 import org.apache.calcite.config.CalciteConnectionProperty;
+import org.apache.phoenix.calcite.rel.PhoenixRel;
 import org.apache.phoenix.end2end.BaseClientManagedTimeIT;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.TableAlreadyExistsException;
@@ -59,8 +61,8 @@ public class BaseCalciteIT extends BaseClientManagedTimeIT {
 setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
 }
 
-public static Start start(boolean materializationEnabled) {
-return new Start(getConnectionProps(materializationEnabled));
+public static Start start(boolean materializationEnabled, float 
rowCountFactor) {
+return new Start(getConnectionProps(materializationEnabled, 
rowCountFactor));
 }
 
 public static Start start(Properties props) {
@@ -308,7 +310,7 @@ public class BaseCalciteIT extends BaseClientManagedTimeIT {
 return connection;
 }
 
-protected static Properties getConnectionProps(boolean 
enableMaterialization) {
+protected static Properties getConnectionProps(boolean 
enableMaterialization, float rowCountFactor) {
 Properties props = new Properties();
 props.setProperty(
 CalciteConnectionProperty.MATERIALIZATIONS_ENABLED.camelName(),
@@ -316,6 +318,7 @@ public class BaseCalciteIT extends BaseClientManagedTimeIT {
 props.setProperty(
 CalciteConnectionProperty.CREATE_MATERIALIZATIONS.camelName(),
 Boolean.toString(false));
+props.setProperty(PhoenixRel.ROW_COUNT_FACTOR, 
Float.toString(rowCountFactor));
 return props;
 }
 
@@ -364,21 +367,13 @@ public class BaseCalciteIT extends 
BaseClientManagedTimeIT {
 PreparedStatement stmt = conn.prepareStatement(
 "UPSERT INTO " + NOSALT_TABLE_NAME
 + " VALUES(?, ?, ?, ?)");
-stmt.setInt(1, 1);
-stmt.setInt(2, 2);
-stmt.setInt(3, 3);
-stmt.setInt(4, 4);
-stmt.execute();
-stmt.setInt(1, 2);
-stmt.setInt(2, 3);
-stmt.setInt(3, 4);
-stmt.setInt(4, 5);
-stmt.execute();
-stmt.setInt(1, 3);
-stmt.setInt(2, 4);
-stmt.setInt(3, 5);
-stmt.setInt(4, 6);
-stmt.execute();
+   

[2/2] phoenix git commit: PHOENIX-2659 Incorrect argument parsing and bad command for queryserver.py (Josh Elser)

2016-02-12 Thread jamestaylor
PHOENIX-2659 Incorrect argument parsing and bad command for
 queryserver.py (Josh Elser)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 03b1dd22933d677b664a98a3ed499c7c4ec03635
Parents: 86222d8
Author: James Taylor 
Authored: Fri Feb 12 10:57:23 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 11:01:22 2016 -0800

--
 bin/queryserver.py | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/03b1dd22/bin/queryserver.py
--
diff --git a/bin/queryserver.py b/bin/queryserver.py
index d4228b3..c80e629 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -55,14 +55,19 @@ if len(args) > 1:
 command = 'stop'
 elif args[1] == 'makeWinServiceDesc':
 command = 'makeWinServiceDesc'
+
 if command:
+# Pull off queryserver.py and the command
 args = args[2:]
+else:
+# Just pull off queryserver.py
+args = args[1:]
 
 if os.name == 'nt':
-args = subprocess.list2cmdline(args[1:])
+args = subprocess.list2cmdline(args)
 else:
 import pipes# pipes module isn't available on Windows
-args = " ".join([pipes.quote(v) for v in args[1:]])
+args = " ".join([pipes.quote(v) for v in args])
 
 # HBase configuration folder path (where hbase-site.xml reside) for
 # HBase/Phoenix client side property override
@@ -119,7 +124,9 @@ else:
 
 #" -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n " 
+ \
 #" -XX:+UnlockCommercialFeatures -XX:+FlightRecorder 
-XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true" + \
-java_cmd = '%(java)s $PHOENIX_OPTS -cp ' + hbase_config_path + os.pathsep + 
hadoop_config_path + os.pathsep + \
+
+# The command is run through subprocess so environment variables are 
automatically inherited
+java_cmd = '%(java)s -cp ' + hbase_config_path + os.pathsep + 
hadoop_config_path + os.pathsep + \
 phoenix_utils.phoenix_queryserver_jar + os.pathsep + 
phoenix_utils.phoenix_client_jar + \
 " -Dproc_phoenixserver" + \
 " -Dlog4j.configuration=file:" + os.path.join(phoenix_utils.current_dir, 
"log4j.properties") + \
@@ -201,5 +208,6 @@ elif command == 'stop':
 else:
 # run in the foreground using defaults from log4j.properties
 cmd = java_cmd % {'java': java, 'root_logger': 'INFO,console', 'log_dir': 
'.', 'log_file': 'psql.log'}
+# Because shell=True is not set, we don't have to alter the environment
 child = subprocess.Popen(cmd.split())
 sys.exit(child.wait())



[1/2] phoenix git commit: PHOENIX-2657 Transactionally deleted cells become visible after few hours

2016-02-12 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 cb5e30139 -> 03b1dd229


PHOENIX-2657 Transactionally deleted cells become visible after few hours


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 86222d87b4154a94c4d5b8cedf7490a0d0c9ceee
Parents: cb5e301
Author: James Taylor 
Authored: Fri Feb 12 09:38:43 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 11:00:47 2016 -0800

--
 .../apache/phoenix/filter/SkipScanFilter.java   | 47 +---
 .../phoenix/index/PhoenixIndexBuilder.java  |  4 +-
 .../index/PhoenixTransactionalIndexer.java  |  5 ++-
 3 files changed, 38 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/86222d87/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java 
b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
index 00320ce..c966d91 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
@@ -43,8 +43,6 @@ import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ScanUtil.BytesComparator;
 import org.apache.phoenix.util.SchemaUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Objects;
 import com.google.common.collect.Lists;
@@ -63,8 +61,6 @@ import com.google.common.hash.Hashing;
  * @since 0.1
  */
 public class SkipScanFilter extends FilterBase implements Writable {
-private static final Logger logger = 
LoggerFactory.getLogger(SkipScanFilter.class);
-
 private enum Terminate {AT, AFTER};
 // Conjunctive normal form of or-ed ranges or point lookups
 private List slots;
@@ -72,6 +68,7 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 private int[] slotSpan;
 // schema of the row key
 private RowKeySchema schema;
+private boolean includeMultipleVersions;
 // current position for each slot
 private int[] position;
 // buffer used for skip hint
@@ -94,19 +91,27 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 public SkipScanFilter() {
 }
 
+public SkipScanFilter(SkipScanFilter filter, boolean 
includeMultipleVersions) {
+this(filter.slots, filter.slotSpan, filter.schema, 
includeMultipleVersions);
+}
+
 public SkipScanFilter(List slots, RowKeySchema schema) {
 this(slots, ScanUtil.getDefaultSlotSpans(slots.size()), schema);
 }
 
 public SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema) {
-init(slots, slotSpan, schema);
+this(slots, slotSpan, schema, false);
+}
+
+private SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema, boolean includeMultipleVersions) {
+init(slots, slotSpan, schema, includeMultipleVersions);
 }
 
 public void setOffset(int offset) {
 this.offset = offset;
 }
 
-private void init(List slots, int[] slotSpan, RowKeySchema 
schema) {
+private void init(List slots, int[] slotSpan, RowKeySchema 
schema, boolean includeMultipleVersions) {
 for (List ranges : slots) {
 if (ranges.isEmpty()) {
 throw new IllegalStateException();
@@ -117,9 +122,10 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 this.schema = schema;
 this.maxKeyLength = SchemaUtil.getMaxKeyLength(schema, slots);
 this.position = new int[slots.size()];
-startKey = new byte[maxKeyLength];
-endKey = new byte[maxKeyLength];
-endKeyLength = 0;
+this.startKey = new byte[maxKeyLength];
+this.endKey = new byte[maxKeyLength];
+this.endKeyLength = 0;
+this.includeMultipleVersions = includeMultipleVersions;
 }
 
 // Exposed for testing.
@@ -345,15 +351,20 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 return i;
 }
 
+private ReturnCode getIncludeReturnCode() {
+return includeMultipleVersions ? ReturnCode.INCLUDE : 
ReturnCode.INCLUDE_AND_NEXT_COL;
+}
+
 @edu.umd.cs.findbugs.annotations.SuppressWarnings(
 value="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT", 
 justification="Assignment designed to work this 

Apache-Phoenix | 4.x-HBase-0.98 | Build Successful

2016-02-12 Thread Apache Jenkins Server
4.x-HBase-0.98 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.x-HBase-0.98

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.x-HBase-0.98/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.x-HBase-0.98/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-2657 Transactionally deleted cells become visible after few

[jtaylor] PHOENIX-2659 Incorrect argument parsing and bad command for 



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


phoenix git commit: PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause

2016-02-12 Thread jyates
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 03b1dd229 -> 35b893d21


PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause

Setting the condition in the PhoenixMapReduceUtil,
as well as some slight cleanup for duplicate code
in setInput(). Adding a test that covers mapreduce
with and without a condition.


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 35b893d219a02da2dd2588fbee1ecd8a33ed25cc
Parents: 03b1dd2
Author: Jesse Yates 
Authored: Wed Feb 10 12:46:47 2016 -0800
Committer: Jesse Yates 
Committed: Fri Feb 12 12:17:30 2016 -0800

--
 .../org/apache/phoenix/end2end/MapReduceIT.java | 230 +++
 .../mapreduce/util/PhoenixMapReduceUtil.java|  65 +++---
 2 files changed, 264 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/35b893d2/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
new file mode 100644
index 000..f030701
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
@@ -0,0 +1,230 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.io.DoubleWritable;
+import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.mapreduce.Reducer;
+import org.apache.hadoop.mapreduce.lib.db.DBWritable;
+import org.apache.phoenix.mapreduce.PhoenixOutputFormat;
+import org.apache.phoenix.mapreduce.util.PhoenixConfigurationUtil;
+import org.apache.phoenix.mapreduce.util.PhoenixMapReduceUtil;
+import org.apache.phoenix.schema.types.PDouble;
+import org.apache.phoenix.schema.types.PhoenixArray;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.sql.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test that our MapReduce basic tools work as expected
+ */
+public class MapReduceIT extends BaseHBaseManagedTimeIT {
+
+private static final String STOCK_TABLE_NAME = "stock";
+private static final String STOCK_STATS_TABLE_NAME = "stock_stats";
+private static final String STOCK_NAME = "STOCK_NAME";
+private static final String RECORDING_YEAR = "RECORDING_YEAR";
+private static final String RECORDINGS_QUARTER = "RECORDINGS_QUARTER";
+private static final String CREATE_STOCK_TABLE = "CREATE TABLE IF NOT 
EXISTS " + STOCK_TABLE_NAME + " ( " +
+STOCK_NAME + " VARCHAR NOT NULL ," + RECORDING_YEAR + " INTEGER 
NOT  NULL, " + RECORDINGS_QUARTER +
+" DOUBLE array[] CONSTRAINT pk PRIMARY KEY (" + STOCK_NAME + " , " 
+ RECORDING_YEAR + "))";
+
+private static final String MAX_RECORDING = "MAX_RECORDING";
+private static final String CREATE_STOCK_STATS_TABLE =
+"CREATE TABLE IF NOT EXISTS " + STOCK_STATS_TABLE_NAME + "(" + 
STOCK_NAME + " VARCHAR NOT NULL , "
++ MAX_RECORDING + " DOUBLE CONSTRAINT pk PRIMARY KEY (" + 
STOCK_NAME + "))";
+private static final String UPSERT = "UPSERT into " + STOCK_TABLE_NAME + " 
values (?, ?, ?)";
+
+@Before
+public void setupTables() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+conn.createStatement().execute(CREATE_STOCK_TABLE);
+conn.createStatement().execute(CREATE_STOCK_STATS_TABLE);
+conn.commit();
+}
+
+@Test
+public void testNoConditionsOnSelect() throws Exception {
+final 

phoenix git commit: PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause

2016-02-12 Thread jyates
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 fd757a055 -> acca4129b


PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause

Setting the condition in the PhoenixMapReduceUtil,
as well as some slight cleanup for duplicate code
in setInput(). Adding a test that covers mapreduce
with and without a condition.


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

Branch: refs/heads/4.x-HBase-1.0
Commit: acca4129b0b038e59ee047d88a8f445d4ebf1e6d
Parents: fd757a0
Author: Jesse Yates 
Authored: Wed Feb 10 12:46:47 2016 -0800
Committer: Jesse Yates 
Committed: Fri Feb 12 12:16:31 2016 -0800

--
 .../org/apache/phoenix/end2end/MapReduceIT.java | 230 +++
 .../mapreduce/util/PhoenixMapReduceUtil.java|  65 +++---
 2 files changed, 264 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/acca4129/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
new file mode 100644
index 000..f030701
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
@@ -0,0 +1,230 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.io.DoubleWritable;
+import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.mapreduce.Reducer;
+import org.apache.hadoop.mapreduce.lib.db.DBWritable;
+import org.apache.phoenix.mapreduce.PhoenixOutputFormat;
+import org.apache.phoenix.mapreduce.util.PhoenixConfigurationUtil;
+import org.apache.phoenix.mapreduce.util.PhoenixMapReduceUtil;
+import org.apache.phoenix.schema.types.PDouble;
+import org.apache.phoenix.schema.types.PhoenixArray;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.sql.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test that our MapReduce basic tools work as expected
+ */
+public class MapReduceIT extends BaseHBaseManagedTimeIT {
+
+private static final String STOCK_TABLE_NAME = "stock";
+private static final String STOCK_STATS_TABLE_NAME = "stock_stats";
+private static final String STOCK_NAME = "STOCK_NAME";
+private static final String RECORDING_YEAR = "RECORDING_YEAR";
+private static final String RECORDINGS_QUARTER = "RECORDINGS_QUARTER";
+private static final String CREATE_STOCK_TABLE = "CREATE TABLE IF NOT 
EXISTS " + STOCK_TABLE_NAME + " ( " +
+STOCK_NAME + " VARCHAR NOT NULL ," + RECORDING_YEAR + " INTEGER 
NOT  NULL, " + RECORDINGS_QUARTER +
+" DOUBLE array[] CONSTRAINT pk PRIMARY KEY (" + STOCK_NAME + " , " 
+ RECORDING_YEAR + "))";
+
+private static final String MAX_RECORDING = "MAX_RECORDING";
+private static final String CREATE_STOCK_STATS_TABLE =
+"CREATE TABLE IF NOT EXISTS " + STOCK_STATS_TABLE_NAME + "(" + 
STOCK_NAME + " VARCHAR NOT NULL , "
++ MAX_RECORDING + " DOUBLE CONSTRAINT pk PRIMARY KEY (" + 
STOCK_NAME + "))";
+private static final String UPSERT = "UPSERT into " + STOCK_TABLE_NAME + " 
values (?, ?, ?)";
+
+@Before
+public void setupTables() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+conn.createStatement().execute(CREATE_STOCK_TABLE);
+conn.createStatement().execute(CREATE_STOCK_STATS_TABLE);
+conn.commit();
+}
+
+@Test
+public void testNoConditionsOnSelect() throws Exception {
+final 

Apache-Phoenix | 4.x-HBase-1.0 | Build Successful

2016-02-12 Thread Apache Jenkins Server
4.x-HBase-1.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.x-HBase-1.0

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-2657 Transactionally deleted cells become visible after few

[jtaylor] PHOENIX-2659 Incorrect argument parsing and bad command for 



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


phoenix git commit: PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause

2016-02-12 Thread jyates
Repository: phoenix
Updated Branches:
  refs/heads/master 0c1fd3ad5 -> 8ece81b55


PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause

Setting the condition in the PhoenixMapReduceUtil,
as well as some slight cleanup for duplicate code
in setInput(). Adding a test that covers mapreduce
with and without a condition.


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

Branch: refs/heads/master
Commit: 8ece81b5522df3e6bd9dfdb3112e101215bb49f1
Parents: 0c1fd3a
Author: Jesse Yates 
Authored: Wed Feb 10 12:46:47 2016 -0800
Committer: Jesse Yates 
Committed: Fri Feb 12 12:15:42 2016 -0800

--
 .../org/apache/phoenix/end2end/MapReduceIT.java | 230 +++
 .../mapreduce/util/PhoenixMapReduceUtil.java|  65 +++---
 2 files changed, 264 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ece81b5/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
new file mode 100644
index 000..f030701
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java
@@ -0,0 +1,230 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.io.DoubleWritable;
+import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.mapreduce.Reducer;
+import org.apache.hadoop.mapreduce.lib.db.DBWritable;
+import org.apache.phoenix.mapreduce.PhoenixOutputFormat;
+import org.apache.phoenix.mapreduce.util.PhoenixConfigurationUtil;
+import org.apache.phoenix.mapreduce.util.PhoenixMapReduceUtil;
+import org.apache.phoenix.schema.types.PDouble;
+import org.apache.phoenix.schema.types.PhoenixArray;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.sql.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test that our MapReduce basic tools work as expected
+ */
+public class MapReduceIT extends BaseHBaseManagedTimeIT {
+
+private static final String STOCK_TABLE_NAME = "stock";
+private static final String STOCK_STATS_TABLE_NAME = "stock_stats";
+private static final String STOCK_NAME = "STOCK_NAME";
+private static final String RECORDING_YEAR = "RECORDING_YEAR";
+private static final String RECORDINGS_QUARTER = "RECORDINGS_QUARTER";
+private static final String CREATE_STOCK_TABLE = "CREATE TABLE IF NOT 
EXISTS " + STOCK_TABLE_NAME + " ( " +
+STOCK_NAME + " VARCHAR NOT NULL ," + RECORDING_YEAR + " INTEGER 
NOT  NULL, " + RECORDINGS_QUARTER +
+" DOUBLE array[] CONSTRAINT pk PRIMARY KEY (" + STOCK_NAME + " , " 
+ RECORDING_YEAR + "))";
+
+private static final String MAX_RECORDING = "MAX_RECORDING";
+private static final String CREATE_STOCK_STATS_TABLE =
+"CREATE TABLE IF NOT EXISTS " + STOCK_STATS_TABLE_NAME + "(" + 
STOCK_NAME + " VARCHAR NOT NULL , "
++ MAX_RECORDING + " DOUBLE CONSTRAINT pk PRIMARY KEY (" + 
STOCK_NAME + "))";
+private static final String UPSERT = "UPSERT into " + STOCK_TABLE_NAME + " 
values (?, ?, ?)";
+
+@Before
+public void setupTables() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+conn.createStatement().execute(CREATE_STOCK_TABLE);
+conn.createStatement().execute(CREATE_STOCK_STATS_TABLE);
+conn.commit();
+}
+
+@Test
+public void testNoConditionsOnSelect() throws Exception {
+final Configuration conf = 

Build failed in Jenkins: Phoenix | Master #1132

2016-02-12 Thread Apache Jenkins Server
See 

Changes:

[jyates] PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition

--
[...truncated 886 lines...]
testSecondaryIndex[transactional = false , mutable = true , localIndex = false, 
directApi = true](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 20.347 
sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = false , mutable = true , localIndex = true, 
directApi = false](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 
24.066 sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = false , mutable = true , localIndex = true, 
directApi = true](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 23.802 
sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = true , mutable = false , localIndex = false, 
directApi = false](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 
22.112 sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = true , mutable = false , localIndex = false, 
directApi = true](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 21.618 
sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = true , mutable = false , localIndex = true, 
directApi = false](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 
21.983 sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = true , mutable = false , localIndex = true, 
directApi = true](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 21.25 
sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = true , mutable = true , localIndex = false, 
directApi = false](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 
18.331 sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = true , mutable = true , localIndex = false, 
directApi = true](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 21.687 
sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = true , mutable = true , localIndex = true, 
directApi = false](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 19.46 
sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

testSecondaryIndex[transactional = true , mutable = true , localIndex = true, 
directApi = true](org.apache.phoenix.end2end.IndexToolIT)  Time elapsed: 19.944 
sec  <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<-1>
at 
org.apache.phoenix.end2end.IndexToolIT.testSecondaryIndex(IndexToolIT.java:162)

Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 386.762 sec - 
in org.apache.phoenix.end2end.CsvBulkLoadToolIT
Running org.apache.phoenix.end2end.TenantSpecificTablesDMLIT
Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 55.091 sec - 
in org.apache.phoenix.end2end.TenantSpecificTablesDDLIT
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 137.585 sec - 
in org.apache.phoenix.end2end.StatsCollectorIT
Running org.apache.phoenix.end2end.TransactionalViewIT
Running org.apache.phoenix.end2end.UnionAllIT
Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 39.613 sec - 
in org.apache.phoenix.end2end.TenantSpecificTablesDMLIT
Running org.apache.phoenix.end2end.ViewIT
Running org.apache.phoenix.end2end.UserDefinedFunctionsIT
Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 36.766 sec - 
in org.apache.phoenix.end2end.UnionAllIT
Running org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 75.058 sec - in 
org.apache.phoenix.end2end.TransactionalViewIT
Running org.apache.phoenix.end2end.index.MutableIndexFailureIT
Tests run: 1, Failures: 0, Errors: 0, 

Build failed in Jenkins: Phoenix-4.x-HBase-1.0 #380

2016-02-12 Thread Apache Jenkins Server
See 

Changes:

[jyates] PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition

--
[...truncated 908 lines...]
org.apache.phoenix.exception.PhoenixIOException: 
org.apache.phoenix.exception.PhoenixIOException: 
org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException: Column family 
CF does not exist in region 
NEWCFTTLTEST,\x05\x00\x00,1455311213805.031577b087e9f5e6f8c97bda603660fa. in 
table 'NEWCFTTLTEST', {TABLE_ATTRIBUTES => {coprocessor$1 => 
'|org.apache.phoenix.coprocessor.ScanRegionObserver|805306366|', coprocessor$2 
=> 
'|org.apache.phoenix.coprocessor.UngroupedAggregateRegionObserver|805306366|', 
coprocessor$3 => 
'|org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver|805306366|', 
coprocessor$4 => 
'|org.apache.phoenix.coprocessor.ServerCachingEndpointImpl|805306366|', 
coprocessor$5 => 
'|org.apache.phoenix.hbase.index.Indexer|805306366|index.builder=org.apache.phoenix.index.PhoenixIndexBuilder,org.apache.hadoop.hbase.index.codec.class=org.apache.phoenix.index.PhoenixIndexCodec',
 coprocessor$6 => 
'|org.apache.hadoop.hbase.regionserver.LocalIndexSplitter|805306366|'}, {NAME 
=> '0', DATA_BLOCK_ENCODING => 'FAST_DIFF', BLOOMFILTER => 'ROW', 
REPLICATION_SCOPE => '0', COMPRESSION => 'NONE', VERSIONS => '1', TTL => '1000 
SECONDS (16 MINUTES 40 SECONDS)', MIN_VERSIONS => '0', KEEP_DELETED_CELLS => 
'FALSE', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
at 
org.apache.hadoop.hbase.regionserver.HRegion.checkFamily(HRegion.java:6093)
at 
org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:2176)
at 
org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:2156)
at 
org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:2064)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:31443)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2033)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:107)
at 
org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
at java.lang.Thread.run(Thread.java:745)

Caused by: java.util.concurrent.ExecutionException: 
org.apache.phoenix.exception.PhoenixIOException: 
org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException: Column family 
CF does not exist in region 
NEWCFTTLTEST,\x05\x00\x00,1455311213805.031577b087e9f5e6f8c97bda603660fa. in 
table 'NEWCFTTLTEST', {TABLE_ATTRIBUTES => {coprocessor$1 => 
'|org.apache.phoenix.coprocessor.ScanRegionObserver|805306366|', coprocessor$2 
=> 
'|org.apache.phoenix.coprocessor.UngroupedAggregateRegionObserver|805306366|', 
coprocessor$3 => 
'|org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver|805306366|', 
coprocessor$4 => 
'|org.apache.phoenix.coprocessor.ServerCachingEndpointImpl|805306366|', 
coprocessor$5 => 
'|org.apache.phoenix.hbase.index.Indexer|805306366|index.builder=org.apache.phoenix.index.PhoenixIndexBuilder,org.apache.hadoop.hbase.index.codec.class=org.apache.phoenix.index.PhoenixIndexCodec',
 coprocessor$6 => 
'|org.apache.hadoop.hbase.regionserver.LocalIndexSplitter|805306366|'}, {NAME 
=> '0', DATA_BLOCK_ENCODING => 'FAST_DIFF', BLOOMFILTER => 'ROW', 
REPLICATION_SCOPE => '0', COMPRESSION => 'NONE', VERSIONS => '1', TTL => '1000 
SECONDS (16 MINUTES 40 SECONDS)', MIN_VERSIONS => '0', KEEP_DELETED_CELLS => 
'FALSE', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
at 
org.apache.hadoop.hbase.regionserver.HRegion.checkFamily(HRegion.java:6093)
at 
org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:2176)
at 
org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:2156)
at 
org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:2064)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:31443)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2033)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:107)
at 
org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.phoenix.exception.PhoenixIOException: 
org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException: Column family 
CF does not exist in region 
NEWCFTTLTEST,\x05\x00\x00,1455311213805.031577b087e9f5e6f8c97bda603660fa. in 
table 'NEWCFTTLTEST', {TABLE_ATTRIBUTES => {coprocessor$1 => 
'|org.apache.phoenix.coprocessor.ScanRegionObserver|805306366|', coprocessor$2 
=> 

Jenkins build is back to normal : Phoenix | 4.x-HBase-0.98 #1059

2016-02-12 Thread Apache Jenkins Server
See 



phoenix git commit: PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause (addendum)

2016-02-12 Thread jyates
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 35b893d21 -> 470477e50


PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause 
(addendum)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 470477e5053075e5ebf128bc3ae532e908a25067
Parents: 35b893d
Author: Jesse Yates 
Authored: Fri Feb 12 15:46:11 2016 -0800
Committer: Jesse Yates 
Committed: Fri Feb 12 16:14:41 2016 -0800

--
 .../org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/470477e5/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
index 125c6a8..98f0364 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
@@ -58,8 +58,9 @@ public final class PhoenixMapReduceUtil {
  * @param inputQuery  Select query.
  */
 public static void setInput(final Job job, final Class inputClass, final String tableName, final String inputQuery) {
-  final Configuration configuration = setInput(job, inputClass, 
tableName);
-  PhoenixConfigurationUtil.setSchemaType(configuration, 
SchemaType.QUERY);
+final Configuration configuration = setInput(job, inputClass, 
tableName);
+PhoenixConfigurationUtil.setInputQuery(configuration, inputQuery);
+PhoenixConfigurationUtil.setSchemaType(configuration, 
SchemaType.QUERY);
  }
 
 private static Configuration setInput(final Job job, final Class inputClass, final String tableName){



phoenix git commit: PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause (addendum)

2016-02-12 Thread jyates
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 acca4129b -> ace996372


PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause 
(addendum)


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

Branch: refs/heads/4.x-HBase-1.0
Commit: ace996372077e7eb84410cb9ddc764a5bec6af2f
Parents: acca412
Author: Jesse Yates 
Authored: Fri Feb 12 15:46:11 2016 -0800
Committer: Jesse Yates 
Committed: Fri Feb 12 16:14:31 2016 -0800

--
 .../org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ace99637/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
index 125c6a8..98f0364 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
@@ -58,8 +58,9 @@ public final class PhoenixMapReduceUtil {
  * @param inputQuery  Select query.
  */
 public static void setInput(final Job job, final Class inputClass, final String tableName, final String inputQuery) {
-  final Configuration configuration = setInput(job, inputClass, 
tableName);
-  PhoenixConfigurationUtil.setSchemaType(configuration, 
SchemaType.QUERY);
+final Configuration configuration = setInput(job, inputClass, 
tableName);
+PhoenixConfigurationUtil.setInputQuery(configuration, inputQuery);
+PhoenixConfigurationUtil.setSchemaType(configuration, 
SchemaType.QUERY);
  }
 
 private static Configuration setInput(final Job job, final Class inputClass, final String tableName){



phoenix git commit: PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause (addendum)

2016-02-12 Thread jyates
Repository: phoenix
Updated Branches:
  refs/heads/master 8ece81b55 -> edd94b28a


PHOENIX-2674 PhoenixMapReduceUtil#setInput doesn't honor condition clause 
(addendum)


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

Branch: refs/heads/master
Commit: edd94b28ab46877aa15e94713274516619fa43b1
Parents: 8ece81b
Author: Jesse Yates 
Authored: Fri Feb 12 15:46:11 2016 -0800
Committer: Jesse Yates 
Committed: Fri Feb 12 15:46:51 2016 -0800

--
 .../org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/edd94b28/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
index 125c6a8..98f0364 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java
@@ -58,8 +58,9 @@ public final class PhoenixMapReduceUtil {
  * @param inputQuery  Select query.
  */
 public static void setInput(final Job job, final Class inputClass, final String tableName, final String inputQuery) {
-  final Configuration configuration = setInput(job, inputClass, 
tableName);
-  PhoenixConfigurationUtil.setSchemaType(configuration, 
SchemaType.QUERY);
+final Configuration configuration = setInput(job, inputClass, 
tableName);
+PhoenixConfigurationUtil.setInputQuery(configuration, inputQuery);
+PhoenixConfigurationUtil.setSchemaType(configuration, 
SchemaType.QUERY);
  }
 
 private static Configuration setInput(final Job job, final Class inputClass, final String tableName){



Jenkins build is back to normal : Phoenix-4.x-HBase-1.0 #381

2016-02-12 Thread Apache Jenkins Server
See 



phoenix git commit: PHOENIX-2090 Refine PhoenixTableScan.computeSelfCost() when scanRanges is available

2016-02-12 Thread maryannxue
Repository: phoenix
Updated Branches:
  refs/heads/calcite 8b68b1c4e -> 52ba5d24d


PHOENIX-2090 Refine PhoenixTableScan.computeSelfCost() when scanRanges is 
available


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

Branch: refs/heads/calcite
Commit: 52ba5d24d6217b0f619f3dd143142ef86cbab02e
Parents: 8b68b1c
Author: maryannxue 
Authored: Fri Feb 12 21:43:12 2016 -0500
Committer: maryannxue 
Committed: Fri Feb 12 21:43:12 2016 -0500

--
 .../it/java/org/apache/phoenix/calcite/CalciteIndexIT.java  | 2 +-
 .../main/java/org/apache/phoenix/calcite/PhoenixTable.java  | 5 +
 .../phoenix/calcite/rel/PhoenixAbstractAggregate.java   | 3 ++-
 .../java/org/apache/phoenix/calcite/rel/PhoenixRel.java | 2 +-
 .../org/apache/phoenix/calcite/rel/PhoenixTableScan.java| 9 +++--
 5 files changed, 12 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/52ba5d24/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java
index 3f0f754..d1aea74 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIndexIT.java
@@ -93,7 +93,7 @@ public class CalciteIndexIT extends BaseCalciteIT {
"  PhoenixServerProject(A_STRING=[$0])\n" +
"PhoenixTableScan(table=[[phoenix, IDX1]], 
scanOrder=[FORWARD])\n")
 .close();
-start(true, 1000f).sql("select a_string from aTable order by 
organization_id")
+start(true, 100f).sql("select a_string from aTable order by 
organization_id")
 .explainIs("PhoenixToEnumerableConverter\n" +
"  PhoenixServerProject(A_STRING=[$2], 
ORGANIZATION_ID=[$0])\n" +
"PhoenixTableScan(table=[[phoenix, ATABLE]], 
scanOrder=[FORWARD])\n")

http://git-wip-us.apache.org/repos/asf/phoenix/blob/52ba5d24/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java 
b/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java
index 1539dcd..fea4c8a 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java
@@ -21,7 +21,6 @@ import org.apache.calcite.schema.impl.AbstractTable;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.calcite.util.ImmutableBitSet;
 import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.phoenix.calcite.rel.PhoenixRel;
 import org.apache.phoenix.calcite.rel.PhoenixTableScan;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.query.QueryServices;
@@ -185,9 +184,7 @@ public class PhoenixTable extends AbstractTable implements 
TranslatableTable {
 return new Statistic() {
 @Override
 public Double getRowCount() {
-float f = pc.getQueryServices().getProps().getFloat(
-PhoenixRel.ROW_COUNT_FACTOR, 1f);
-return (double) (rowCount * f);
+return (double) rowCount;
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/52ba5d24/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixAbstractAggregate.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixAbstractAggregate.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixAbstractAggregate.java
index 9d76f59..de9f0c2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixAbstractAggregate.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixAbstractAggregate.java
@@ -105,6 +105,7 @@ abstract public class PhoenixAbstractAggregate extends 
Aggregate implements Phoe
 return planner.getCostFactory().makeInfiniteCost();
 
 double rowCount = mq.getRowCount(this);
+double bytesPerRow = mq.getAverageRowSize(this);
 if (isOrderedGroupBy) {
 rowCount = (rowCount * rowCount) / Util.nLogN(rowCount);
 }
@@ -117,7 +118,7 @@ abstract public