git commit: PHOENIX-1137 SkipScanFilter.intersect not called for aggregate queries (Lars Hofhansl)

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.0 b9f9fa65a -> ee4725385


PHOENIX-1137 SkipScanFilter.intersect not called for aggregate queries (Lars 
Hofhansl)


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

Branch: refs/heads/4.0
Commit: ee4725385e612c25b18bcbcaa9fa03ab65255813
Parents: b9f9fa6
Author: James Taylor 
Authored: Mon Aug 4 23:17:55 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 23:17:55 2014 -0700

--
 .../java/org/apache/phoenix/util/ScanUtil.java  | 26 ++--
 1 file changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ee472538/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
index 8ad786f..15977cf 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
@@ -162,21 +162,21 @@ public class ScanUtil {
 // Intersect found: replace skip scan with intersected one
 scan.setFilter(newFilter);
 } else if (filter instanceof FilterList) {
-FilterList filterList = (FilterList)filter;
-Filter firstFilter = filterList.getFilters().get(0);
-if (firstFilter instanceof SkipScanFilter) {
-SkipScanFilter oldFilter = (SkipScanFilter)firstFilter;
-SkipScanFilter newFilter = oldFilter.intersect(startKey, 
stopKey);
-if (newFilter == null) {
-return false;
+FilterList oldList = (FilterList)filter;
+FilterList newList = new 
FilterList(FilterList.Operator.MUST_PASS_ALL);
+for (Filter f : oldList.getFilters()) {
+if (f instanceof SkipScanFilter) {
+SkipScanFilter newFilter = 
((SkipScanFilter)f).intersect(startKey, stopKey);
+if (newFilter == null) {
+return false;
+}
+newList.addFilter(newFilter);
+} else {
+newList.addFilter(f);
 }
-// Intersect found: replace skip scan with intersected one
-List allFilters = new 
ArrayList(filterList.getFilters().size());
-allFilters.addAll(filterList.getFilters());
-allFilters.set(0, newFilter);
-scan.setFilter(new 
FilterList(FilterList.Operator.MUST_PASS_ALL,allFilters));
 }
-}
+scan.setFilter(newList);
+   }
 }
 return mayHaveRows;
 }



git commit: PHOENIX-1137 SkipScanFilter.intersect not called for aggregate queries (Lars Hofhansl)

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master f1c7fc879 -> 4493b9c0a


PHOENIX-1137 SkipScanFilter.intersect not called for aggregate queries (Lars 
Hofhansl)


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

Branch: refs/heads/master
Commit: 4493b9c0ae1b46704bf25af67328c56123f1ccd3
Parents: f1c7fc8
Author: James Taylor 
Authored: Mon Aug 4 23:18:17 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 23:18:17 2014 -0700

--
 .../java/org/apache/phoenix/util/ScanUtil.java  | 26 ++--
 1 file changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4493b9c0/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
index 8ad786f..15977cf 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
@@ -162,21 +162,21 @@ public class ScanUtil {
 // Intersect found: replace skip scan with intersected one
 scan.setFilter(newFilter);
 } else if (filter instanceof FilterList) {
-FilterList filterList = (FilterList)filter;
-Filter firstFilter = filterList.getFilters().get(0);
-if (firstFilter instanceof SkipScanFilter) {
-SkipScanFilter oldFilter = (SkipScanFilter)firstFilter;
-SkipScanFilter newFilter = oldFilter.intersect(startKey, 
stopKey);
-if (newFilter == null) {
-return false;
+FilterList oldList = (FilterList)filter;
+FilterList newList = new 
FilterList(FilterList.Operator.MUST_PASS_ALL);
+for (Filter f : oldList.getFilters()) {
+if (f instanceof SkipScanFilter) {
+SkipScanFilter newFilter = 
((SkipScanFilter)f).intersect(startKey, stopKey);
+if (newFilter == null) {
+return false;
+}
+newList.addFilter(newFilter);
+} else {
+newList.addFilter(f);
 }
-// Intersect found: replace skip scan with intersected one
-List allFilters = new 
ArrayList(filterList.getFilters().size());
-allFilters.addAll(filterList.getFilters());
-allFilters.set(0, newFilter);
-scan.setFilter(new 
FilterList(FilterList.Operator.MUST_PASS_ALL,allFilters));
 }
-}
+scan.setFilter(newList);
+   }
 }
 return mayHaveRows;
 }



git commit: PHOENIX-1137 SkipScanFilter.intersect not called for aggregate queries (Lars Hofhansl)

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/3.0 1bd787441 -> defbd3477


PHOENIX-1137 SkipScanFilter.intersect not called for aggregate queries (Lars 
Hofhansl)


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

Branch: refs/heads/3.0
Commit: defbd347738c45d6df1120d439fdb38f7369ce66
Parents: 1bd7874
Author: James Taylor 
Authored: Mon Aug 4 23:16:54 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 23:16:54 2014 -0700

--
 .../java/org/apache/phoenix/util/ScanUtil.java  | 26 ++--
 1 file changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/defbd347/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
index 5375169..b156ae0 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
@@ -136,21 +136,21 @@ public class ScanUtil {
 // Intersect found: replace skip scan with intersected one
 scan.setFilter(newFilter);
 } else if (filter instanceof FilterList) {
-FilterList filterList = (FilterList)filter;
-Filter firstFilter = filterList.getFilters().get(0);
-if (firstFilter instanceof SkipScanFilter) {
-SkipScanFilter oldFilter = (SkipScanFilter)firstFilter;
-SkipScanFilter newFilter = oldFilter.intersect(startKey, 
stopKey);
-if (newFilter == null) {
-return false;
+FilterList oldList = (FilterList)filter;
+FilterList newList = new 
FilterList(FilterList.Operator.MUST_PASS_ALL);
+for (Filter f : oldList.getFilters()) {
+if (f instanceof SkipScanFilter) {
+SkipScanFilter newFilter = 
((SkipScanFilter)f).intersect(startKey, stopKey);
+if (newFilter == null) {
+return false;
+}
+newList.addFilter(newFilter);
+} else {
+newList.addFilter(f);
 }
-// Intersect found: replace skip scan with intersected one
-List allFilters = new 
ArrayList(filterList.getFilters().size());
-allFilters.addAll(filterList.getFilters());
-allFilters.set(0, newFilter);
-scan.setFilter(new 
FilterList(FilterList.Operator.MUST_PASS_ALL,allFilters));
 }
-}
+scan.setFilter(newList);
+   }
 }
 return mayHaveRows;
 }



git commit: Removing unused imports and tagging methods with override

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/3.0 e574d1ea8 -> 1bd787441


Removing unused imports and tagging methods with override


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

Branch: refs/heads/3.0
Commit: 1bd7874412fc99f94459f31f32cbda7fbcc9d6b2
Parents: e574d1e
Author: James Taylor 
Authored: Mon Aug 4 23:15:06 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 23:15:06 2014 -0700

--
 .../phoenix/end2end/index/MutableIndexFailureIT.java  |  2 +-
 .../apache/phoenix/coprocessor/MetaDataEndpointImpl.java  |  3 +--
 .../phoenix/coprocessor/MetaDataRegionObserver.java   | 10 +-
 .../apache/phoenix/query/ConnectionQueryServicesImpl.java |  1 -
 .../main/java/org/apache/phoenix/util/MetaDataUtil.java   |  7 ---
 5 files changed, 7 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1bd78744/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
index bd9ec52..8fa8e20 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
@@ -134,7 +134,7 @@ public class MutableIndexFailureIT extends BaseTest {
 conn.commit();
 
 byte[] indexTable = Bytes.toBytes(INDEX_TABLE_FULL_NAME);
-HBaseAdmin admin = this.util.getHBaseAdmin();
+HBaseAdmin admin = util.getHBaseAdmin();
 HTableDescriptor indexTableDesc = admin.getTableDescriptor(indexTable);
 try{
   admin.disableTable(indexTable);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1bd78744/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index 13adff8..09625ec 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -30,6 +30,7 @@ import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DEFAULT_COLUMN_FAM
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DISABLE_WAL_BYTES;
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.FAMILY_NAME_INDEX;
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IMMUTABLE_ROWS_BYTES;
+import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_DISABLE_TIMESTAMP_BYTES;
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_STATE_BYTES;
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_VIEW_REFERENCED_BYTES;
 import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE_BYTES;
@@ -49,7 +50,6 @@ import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_CONSTANT_BYTE
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_INDEX_ID_BYTES;
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_STATEMENT_BYTES;
 import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_TYPE_BYTES;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_DISABLE_TIMESTAMP_BYTES;
 import static org.apache.phoenix.schema.PTableType.INDEX;
 import static org.apache.phoenix.util.SchemaUtil.getVarCharLength;
 import static org.apache.phoenix.util.SchemaUtil.getVarChars;
@@ -64,7 +64,6 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.hadoop.hbase.CoprocessorEnvironment;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.client.Delete;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1bd78744/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
index 5fcdb8b..66b60ce 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
+++ 
b/phoenix-core/src/main/j

git commit: Lower log level of static tracing initialization failure to warning

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master a9dfc135d -> f1c7fc879


Lower log level of static tracing initialization failure to warning


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

Branch: refs/heads/master
Commit: f1c7fc879958be9a54b889d4e3fa3e6c9a10fc74
Parents: a9dfc13
Author: James Taylor 
Authored: Mon Aug 4 22:17:04 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 22:18:20 2014 -0700

--
 .../src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f1c7fc87/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
index d6dd5f7..364e61f 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
@@ -132,7 +132,7 @@ public class PhoenixConnection implements Connection, 
org.apache.phoenix.jdbc.Jd
 try {
 Trace.addReceiver(TracingCompat.newTraceMetricSource());
 } catch (RuntimeException e) {
-LOG.error("Tracing will outputs will not be written to any metrics 
sink! No "
+LOG.warn("Tracing will outputs will not be written to any metrics 
sink! No "
 + "TraceMetricsSink found on the classpath", e);
 }
 }
@@ -391,6 +391,7 @@ public class PhoenixConnection implements Connection, 
org.apache.phoenix.jdbc.Jd
 @Override
 public void commit() throws SQLException {
 CallRunner.run(new CallRunner.CallableThrowable() {
+@Override
 public Void call() throws SQLException {
 mutationState.commit();
 return null;



git commit: Lower log level of static tracing initialization failure to warning

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.0 67d3b24d9 -> b9f9fa65a


Lower log level of static tracing initialization failure to warning


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

Branch: refs/heads/4.0
Commit: b9f9fa65a7ec60eab316f73fc9980520d4b3fd88
Parents: 67d3b24
Author: James Taylor 
Authored: Mon Aug 4 22:17:04 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 22:17:04 2014 -0700

--
 .../src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b9f9fa65/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
index d6dd5f7..364e61f 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
@@ -132,7 +132,7 @@ public class PhoenixConnection implements Connection, 
org.apache.phoenix.jdbc.Jd
 try {
 Trace.addReceiver(TracingCompat.newTraceMetricSource());
 } catch (RuntimeException e) {
-LOG.error("Tracing will outputs will not be written to any metrics 
sink! No "
+LOG.warn("Tracing will outputs will not be written to any metrics 
sink! No "
 + "TraceMetricsSink found on the classpath", e);
 }
 }
@@ -391,6 +391,7 @@ public class PhoenixConnection implements Connection, 
org.apache.phoenix.jdbc.Jd
 @Override
 public void commit() throws SQLException {
 CallRunner.run(new CallRunner.CallableThrowable() {
+@Override
 public Void call() throws SQLException {
 mutationState.commit();
 return null;



Apache-Phoenix | Master | Hadoop1 | Build Successful

2014-08-04 Thread Apache Jenkins Server
Master branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf/incubator-phoenix.git

Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-master-hadoop1/lastSuccessfulBuild/artifact/

Last Complete Test Report https://builds.apache.org/job/Phoenix-master-hadoop1/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)



Apache-Phoenix | 4.0 | Hadoop1 | Build Successful

2014-08-04 Thread Apache Jenkins Server
4.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf/incubator-phoenix.git

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.0-hadoop1/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.0-hadoop1/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)



Apache-Phoenix | 3.0 | Hadoop1 | Build Successful

2014-08-04 Thread Apache Jenkins Server
3.0 branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git

Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-3.0-hadoop1/lastSuccessfulBuild/artifact/

Last Complete Test Report https://builds.apache.org/job/Phoenix-3.0-hadoop1/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)



[2/2] git commit: PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)

2014-08-04 Thread jamestaylor
PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)


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

Branch: refs/heads/master
Commit: a9dfc135da7e7093791e0d2e88eca0bbf9909deb
Parents: 90b9ec8
Author: James Taylor 
Authored: Mon Aug 4 11:57:50 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 13:01:44 2014 -0700

--
 .../org/apache/phoenix/end2end/QueryMoreIT.java |  19 ++-
 .../org/apache/phoenix/end2end/QueryPlanIT.java |   5 +-
 .../phoenix/end2end/RowValueConstructorIT.java  | 136 +++
 .../phoenix/end2end/VariableLengthPKIT.java |  10 +-
 .../org/apache/phoenix/compile/ScanRanges.java  |  12 +-
 .../apache/phoenix/compile/WhereOptimizer.java  |  21 ++-
 .../phoenix/expression/CaseExpression.java  |   6 -
 .../phoenix/expression/InListExpression.java|  29 +---
 .../expression/function/PrefixFunction.java |  35 ++--
 .../expression/function/RTrimFunction.java  |  27 ++-
 .../expression/function/ScalarFunction.java |   9 +
 .../java/org/apache/phoenix/query/KeyRange.java |  29 
 .../org/apache/phoenix/schema/PDataType.java|  25 +++
 .../org/apache/phoenix/schema/PTableImpl.java   |   9 +-
 .../java/org/apache/phoenix/util/ByteUtil.java  |  19 ++-
 .../java/org/apache/phoenix/util/ScanUtil.java  |  16 +-
 .../phoenix/compile/QueryCompilerTest.java  |   8 +-
 .../compile/StatementHintsCompilationTest.java  |   2 +-
 .../phoenix/compile/WhereCompilerTest.java  |  10 +-
 .../phoenix/compile/WhereOptimizerTest.java | 166 +++
 .../org/apache/phoenix/util/ScanUtilTest.java   |  36 ++--
 21 files changed, 450 insertions(+), 179 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a9dfc135/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
index 50b3d47..5173b0e 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
@@ -17,7 +17,6 @@
  */
 package org.apache.phoenix.end2end;
 
-import static org.apache.commons.lang.StringUtils.rightPad;
 import static org.junit.Assert.assertEquals;
 
 import java.sql.Connection;
@@ -95,15 +94,20 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute(baseDataTableDDL);
 conn.close();
 
-//upsert rows in the history table.
+//upsert rows in the data table.
 Map> historyIdsPerTenant = 
createHistoryTableRows(dataTableName, tenantIds, numRowsPerTenant);
 
-//create sequence. Use the sequence to upsert select records in cursor 
table.
 String tenantId = tenantIds[0];
 String cursorQueryId = "00TcursrqueryId";
 String tenantViewName = dataTableMultiTenant ? ("HISTORY_TABLE" + "_" 
+ tenantId) : null;
 assertEquals(numRowsPerTenant, 
upsertSelectRecordsInCursorTableForTenant(dataTableName, dataTableMultiTenant, 
tenantId, tenantViewName, cursorQueryId));
 
+Connection conn2 = DriverManager.getConnection(getUrl());
+ResultSet rs = conn2.createStatement().executeQuery("SELECT count(*) 
from " + cursorTableName);
+rs.next();
+assertEquals(numRowsPerTenant, rs.getInt(1));
+conn2.close();
+
 int startOrder = 0;
 int endOrder = 5;
 int numRecordsThatShouldBeRetrieved = 5;
@@ -132,9 +136,10 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 List parentIds = new ArrayList();
 for (int i = 0; i < numRowsPerTenant; i++) {
 stmt.setString(1, tenantIds[j]);
-stmt.setString(2, rightPad("parentId", 15, 'p'));
+String parentId = "parentId" + i;
+stmt.setString(2, parentId);
 stmt.setDate(3, new Date(100));
-String historyId = rightPad("history" + i, 15, 'h'); 
+String historyId = "historyId" + i; 
 stmt.setString(4, historyId);
 stmt.setString(5, "datatype");
 stmt.setString(6, "oldval");
@@ -154,6 +159,8 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 private int upsertSelectRecordsInCursorTableForTenant(String 
baseTableName, boolean dataTableMultiTenant, String tenantId, String 
tenantViewName, String cursorQueryId) throws Exception {
  

[1/2] PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 90b9ec8ec -> a9dfc135d


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a9dfc135/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
index 8fa5314..b1246b8 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
@@ -128,7 +128,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("1"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("A"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 2, Lower bound, all range keys, all inclusive.
@@ -138,7 +138,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 3, Lower bound, mixed single and range keys, all inclusive.
@@ -148,7 +148,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("A"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 4, Lower bound, all range key, all exclusive on lower bound.
@@ -158,7 +158,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), false, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("b2B"), 3),
+PDataType.CHAR.toBytes("b2B"),
 Bound.LOWER
 ));
 // 5, Lower bound, all range key, some exclusive.
@@ -168,7 +168,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("b1B"), 3),
+PDataType.CHAR.toBytes("b1B"),
 Bound.LOWER
 ));
 // 6, Lower bound, mixed single and range key, mixed inclusive and 
exclusive.
@@ -178,7 +178,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1B"), 3),
+PDataType.CHAR.toBytes("a1B"),
 Bound.LOWER
 ));
 // 7, Lower bound, unbound key in the middle, fixed length.
@@ -188,7 +188,7 @@ public class ScanUtilTest {
 KeyRange.EVERYTHING_RANGE,},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a"), 1),
+PDataType.CHAR.toBytes("a"),
 Bound.LOWER
 ));
 // 8, Lower bound, unbound key in the middle, variable length.
@@ -197,7 +197,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("a"), true, 
Bytes.toBytes("a"), true),},{
 KeyRange.EVERYTHING_RANGE,}},
 new int[] {1,1},
-ByteUtil.concat(PDataType.VARCHAR.toBytes("a")),
+PDataType.CHAR.toBytes("a"),
 Bound.LOWER
 ));
 // 9, Lower bound, unbound key at end, variable length.
@@ -207,7 +207,7 @@ public class ScanUtilTest {
 KeyRange.EVERYTHING_RANGE,},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes(

[1/2] PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.0 0c9863ed9 -> 67d3b24d9


http://git-wip-us.apache.org/repos/asf/phoenix/blob/67d3b24d/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
index 8fa5314..b1246b8 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
@@ -128,7 +128,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("1"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("A"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 2, Lower bound, all range keys, all inclusive.
@@ -138,7 +138,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 3, Lower bound, mixed single and range keys, all inclusive.
@@ -148,7 +148,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("A"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 4, Lower bound, all range key, all exclusive on lower bound.
@@ -158,7 +158,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), false, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("b2B"), 3),
+PDataType.CHAR.toBytes("b2B"),
 Bound.LOWER
 ));
 // 5, Lower bound, all range key, some exclusive.
@@ -168,7 +168,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("b1B"), 3),
+PDataType.CHAR.toBytes("b1B"),
 Bound.LOWER
 ));
 // 6, Lower bound, mixed single and range key, mixed inclusive and 
exclusive.
@@ -178,7 +178,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1B"), 3),
+PDataType.CHAR.toBytes("a1B"),
 Bound.LOWER
 ));
 // 7, Lower bound, unbound key in the middle, fixed length.
@@ -188,7 +188,7 @@ public class ScanUtilTest {
 KeyRange.EVERYTHING_RANGE,},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a"), 1),
+PDataType.CHAR.toBytes("a"),
 Bound.LOWER
 ));
 // 8, Lower bound, unbound key in the middle, variable length.
@@ -197,7 +197,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("a"), true, 
Bytes.toBytes("a"), true),},{
 KeyRange.EVERYTHING_RANGE,}},
 new int[] {1,1},
-ByteUtil.concat(PDataType.VARCHAR.toBytes("a")),
+PDataType.CHAR.toBytes("a"),
 Bound.LOWER
 ));
 // 9, Lower bound, unbound key at end, variable length.
@@ -207,7 +207,7 @@ public class ScanUtilTest {
 KeyRange.EVERYTHING_RANGE,},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("B"

[2/2] git commit: PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)

2014-08-04 Thread jamestaylor
PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)


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

Branch: refs/heads/4.0
Commit: 67d3b24d97c39e98ac8c8338073adf0fe1d0ec8b
Parents: 0c9863e
Author: James Taylor 
Authored: Mon Aug 4 11:57:50 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 11:59:03 2014 -0700

--
 .../org/apache/phoenix/end2end/QueryMoreIT.java |  19 ++-
 .../org/apache/phoenix/end2end/QueryPlanIT.java |   5 +-
 .../phoenix/end2end/RowValueConstructorIT.java  | 136 +++
 .../phoenix/end2end/VariableLengthPKIT.java |  10 +-
 .../org/apache/phoenix/compile/ScanRanges.java  |  12 +-
 .../apache/phoenix/compile/WhereOptimizer.java  |  21 ++-
 .../phoenix/expression/CaseExpression.java  |   6 -
 .../phoenix/expression/InListExpression.java|  29 +---
 .../expression/function/PrefixFunction.java |  35 ++--
 .../expression/function/RTrimFunction.java  |  27 ++-
 .../expression/function/ScalarFunction.java |   9 +
 .../java/org/apache/phoenix/query/KeyRange.java |  29 
 .../org/apache/phoenix/schema/PDataType.java|  25 +++
 .../org/apache/phoenix/schema/PTableImpl.java   |   9 +-
 .../java/org/apache/phoenix/util/ByteUtil.java  |  19 ++-
 .../java/org/apache/phoenix/util/ScanUtil.java  |  16 +-
 .../phoenix/compile/QueryCompilerTest.java  |   8 +-
 .../compile/StatementHintsCompilationTest.java  |   2 +-
 .../phoenix/compile/WhereCompilerTest.java  |  10 +-
 .../phoenix/compile/WhereOptimizerTest.java | 166 +++
 .../org/apache/phoenix/util/ScanUtilTest.java   |  36 ++--
 21 files changed, 450 insertions(+), 179 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/67d3b24d/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
index 50b3d47..5173b0e 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
@@ -17,7 +17,6 @@
  */
 package org.apache.phoenix.end2end;
 
-import static org.apache.commons.lang.StringUtils.rightPad;
 import static org.junit.Assert.assertEquals;
 
 import java.sql.Connection;
@@ -95,15 +94,20 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute(baseDataTableDDL);
 conn.close();
 
-//upsert rows in the history table.
+//upsert rows in the data table.
 Map> historyIdsPerTenant = 
createHistoryTableRows(dataTableName, tenantIds, numRowsPerTenant);
 
-//create sequence. Use the sequence to upsert select records in cursor 
table.
 String tenantId = tenantIds[0];
 String cursorQueryId = "00TcursrqueryId";
 String tenantViewName = dataTableMultiTenant ? ("HISTORY_TABLE" + "_" 
+ tenantId) : null;
 assertEquals(numRowsPerTenant, 
upsertSelectRecordsInCursorTableForTenant(dataTableName, dataTableMultiTenant, 
tenantId, tenantViewName, cursorQueryId));
 
+Connection conn2 = DriverManager.getConnection(getUrl());
+ResultSet rs = conn2.createStatement().executeQuery("SELECT count(*) 
from " + cursorTableName);
+rs.next();
+assertEquals(numRowsPerTenant, rs.getInt(1));
+conn2.close();
+
 int startOrder = 0;
 int endOrder = 5;
 int numRecordsThatShouldBeRetrieved = 5;
@@ -132,9 +136,10 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 List parentIds = new ArrayList();
 for (int i = 0; i < numRowsPerTenant; i++) {
 stmt.setString(1, tenantIds[j]);
-stmt.setString(2, rightPad("parentId", 15, 'p'));
+String parentId = "parentId" + i;
+stmt.setString(2, parentId);
 stmt.setDate(3, new Date(100));
-String historyId = rightPad("history" + i, 15, 'h'); 
+String historyId = "historyId" + i; 
 stmt.setString(4, historyId);
 stmt.setString(5, "datatype");
 stmt.setString(6, "oldval");
@@ -154,6 +159,8 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 private int upsertSelectRecordsInCursorTableForTenant(String 
baseTableName, boolean dataTableMultiTenant, String tenantId, String 
tenantViewName, String cursorQueryId) throws Exception {
 

[2/2] git commit: PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)

2014-08-04 Thread jamestaylor
PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)


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

Branch: refs/heads/3.0
Commit: e574d1ea888d8d2e29ed787b8ed8edf54905c68b
Parents: ddf970a
Author: James Taylor 
Authored: Mon Aug 4 11:57:50 2014 -0700
Committer: James Taylor 
Committed: Mon Aug 4 11:57:50 2014 -0700

--
 .../org/apache/phoenix/end2end/QueryMoreIT.java |  19 ++-
 .../org/apache/phoenix/end2end/QueryPlanIT.java |   5 +-
 .../phoenix/end2end/RowValueConstructorIT.java  | 136 +++
 .../phoenix/end2end/VariableLengthPKIT.java |  10 +-
 .../org/apache/phoenix/compile/ScanRanges.java  |  12 +-
 .../apache/phoenix/compile/WhereOptimizer.java  |  21 ++-
 .../phoenix/expression/CaseExpression.java  |   6 -
 .../phoenix/expression/InListExpression.java|  29 +---
 .../expression/function/PrefixFunction.java |  35 ++--
 .../expression/function/RTrimFunction.java  |  27 ++-
 .../expression/function/ScalarFunction.java |   9 +
 .../java/org/apache/phoenix/query/KeyRange.java |  29 
 .../org/apache/phoenix/schema/PDataType.java|  25 +++
 .../org/apache/phoenix/schema/PTableImpl.java   |   9 +-
 .../java/org/apache/phoenix/util/ByteUtil.java  |  19 ++-
 .../java/org/apache/phoenix/util/ScanUtil.java  |  16 +-
 .../phoenix/compile/QueryCompilerTest.java  |   8 +-
 .../compile/StatementHintsCompilationTest.java  |   2 +-
 .../phoenix/compile/WhereCompilerTest.java  |  10 +-
 .../phoenix/compile/WhereOptimizerTest.java | 166 +++
 .../org/apache/phoenix/util/ScanUtilTest.java   |  36 ++--
 21 files changed, 450 insertions(+), 179 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e574d1ea/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
index 50b3d47..5173b0e 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
@@ -17,7 +17,6 @@
  */
 package org.apache.phoenix.end2end;
 
-import static org.apache.commons.lang.StringUtils.rightPad;
 import static org.junit.Assert.assertEquals;
 
 import java.sql.Connection;
@@ -95,15 +94,20 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute(baseDataTableDDL);
 conn.close();
 
-//upsert rows in the history table.
+//upsert rows in the data table.
 Map> historyIdsPerTenant = 
createHistoryTableRows(dataTableName, tenantIds, numRowsPerTenant);
 
-//create sequence. Use the sequence to upsert select records in cursor 
table.
 String tenantId = tenantIds[0];
 String cursorQueryId = "00TcursrqueryId";
 String tenantViewName = dataTableMultiTenant ? ("HISTORY_TABLE" + "_" 
+ tenantId) : null;
 assertEquals(numRowsPerTenant, 
upsertSelectRecordsInCursorTableForTenant(dataTableName, dataTableMultiTenant, 
tenantId, tenantViewName, cursorQueryId));
 
+Connection conn2 = DriverManager.getConnection(getUrl());
+ResultSet rs = conn2.createStatement().executeQuery("SELECT count(*) 
from " + cursorTableName);
+rs.next();
+assertEquals(numRowsPerTenant, rs.getInt(1));
+conn2.close();
+
 int startOrder = 0;
 int endOrder = 5;
 int numRecordsThatShouldBeRetrieved = 5;
@@ -132,9 +136,10 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 List parentIds = new ArrayList();
 for (int i = 0; i < numRowsPerTenant; i++) {
 stmt.setString(1, tenantIds[j]);
-stmt.setString(2, rightPad("parentId", 15, 'p'));
+String parentId = "parentId" + i;
+stmt.setString(2, parentId);
 stmt.setDate(3, new Date(100));
-String historyId = rightPad("history" + i, 15, 'h'); 
+String historyId = "historyId" + i; 
 stmt.setString(4, historyId);
 stmt.setString(5, "datatype");
 stmt.setString(6, "oldval");
@@ -154,6 +159,8 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
 private int upsertSelectRecordsInCursorTableForTenant(String 
baseTableName, boolean dataTableMultiTenant, String tenantId, String 
tenantViewName, String cursorQueryId) throws Exception {
 

[1/2] PHOENIX-1140 Incorrect padding for row key columns (Samarth Jain)

2014-08-04 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/3.0 ddf970a38 -> e574d1ea8


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e574d1ea/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
index 8fa5314..b1246b8 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/util/ScanUtilTest.java
@@ -128,7 +128,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("1"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("A"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 2, Lower bound, all range keys, all inclusive.
@@ -138,7 +138,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 3, Lower bound, mixed single and range keys, all inclusive.
@@ -148,7 +148,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("A"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1A"), 3),
+PDataType.CHAR.toBytes("a1A"),
 Bound.LOWER
 ));
 // 4, Lower bound, all range key, all exclusive on lower bound.
@@ -158,7 +158,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), false, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("b2B"), 3),
+PDataType.CHAR.toBytes("b2B"),
 Bound.LOWER
 ));
 // 5, Lower bound, all range key, some exclusive.
@@ -168,7 +168,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("b1B"), 3),
+PDataType.CHAR.toBytes("b1B"),
 Bound.LOWER
 ));
 // 6, Lower bound, mixed single and range key, mixed inclusive and 
exclusive.
@@ -178,7 +178,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("1"), true, 
Bytes.toBytes("2"), true),},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a1B"), 3),
+PDataType.CHAR.toBytes("a1B"),
 Bound.LOWER
 ));
 // 7, Lower bound, unbound key in the middle, fixed length.
@@ -188,7 +188,7 @@ public class ScanUtilTest {
 KeyRange.EVERYTHING_RANGE,},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), false, 
Bytes.toBytes("B"), true),}},
 new int[] {1,1,1},
-ByteUtil.fillKey(PDataType.VARCHAR.toBytes("a"), 1),
+PDataType.CHAR.toBytes("a"),
 Bound.LOWER
 ));
 // 8, Lower bound, unbound key in the middle, variable length.
@@ -197,7 +197,7 @@ public class ScanUtilTest {
 PDataType.CHAR.getKeyRange(Bytes.toBytes("a"), true, 
Bytes.toBytes("a"), true),},{
 KeyRange.EVERYTHING_RANGE,}},
 new int[] {1,1},
-ByteUtil.concat(PDataType.VARCHAR.toBytes("a")),
+PDataType.CHAR.toBytes("a"),
 Bound.LOWER
 ));
 // 9, Lower bound, unbound key at end, variable length.
@@ -207,7 +207,7 @@ public class ScanUtilTest {
 KeyRange.EVERYTHING_RANGE,},{
 PDataType.CHAR.getKeyRange(Bytes.toBytes("A"), true, 
Bytes.toBytes("B"