Jenkins build is back to normal : Phoenix | Master #1178

2016-03-28 Thread Apache Jenkins Server
See 



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

2016-03-28 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
[tdsilva] PHOENIX-2803 Initializing ToCharFunction with the List<_expression_>



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


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

2016-03-28 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-2774 MemStoreScanner and KeyValueStore should not be aware of

[jtaylor] PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc

[jtaylor] PHOENIX-2760 Upgrade phoenix-server and phoenix-server-client to



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


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

2016-03-28 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-2774 MemStoreScanner and KeyValueStore should not be aware of



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


Build failed in Jenkins: Phoenix | Master #1176

2016-03-28 Thread Apache Jenkins Server
See 

Changes:

[jtaylor] PHOENIX-2774 MemStoreScanner and KeyValueStore should not be aware of

[jtaylor] PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc

[jtaylor] PHOENIX-2760 Upgrade phoenix-server and phoenix-server-client to 
Avatica

--
[...truncated 2052 lines...]

Running org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT
org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT  Time elapsed: 0.005 
sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT.doSetup(ImmutableIndexWithStatsIT.java:52)
Caused by: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT.doSetup(ImmutableIndexWithStatsIT.java:52)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT.doSetup(ImmutableIndexWithStatsIT.java:52)

Running org.apache.phoenix.end2end.index.MutableIndexFailureIT
Running org.apache.phoenix.end2end.index.MutableIndexReplicationIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.005 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.MutableIndexFailureIT
org.apache.phoenix.end2end.index.MutableIndexFailureIT  Time elapsed: 0.004 sec 
 <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT.doSetup(MutableIndexFailureIT.java:108)
Caused by: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT.doSetup(MutableIndexFailureIT.java:108)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT.doSetup(MutableIndexFailureIT.java:108)

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.016 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.MutableIndexReplicationIT
org.apache.phoenix.end2end.index.MutableIndexReplicationIT  Time elapsed: 0.006 
sec  <<< ERROR!
java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.MutableIndexReplicationIT.setupConfigsAndStartCluster(MutableIndexReplicationIT.java:170)
at 
org.apache.phoenix.end2end.index.MutableIndexReplicationIT.setUpBeforeClass(MutableIndexReplicationIT.java:108)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.MutableIndexReplicationIT.setupConfigsAndStartCluster(MutableIndexReplicationIT.java:170)
at 
org.apache.phoenix.end2end.index.MutableIndexReplicationIT.setUpBeforeClass(MutableIndexReplicationIT.java:108)

Running org.apache.phoenix.hbase.index.FailForUnsupportedHBaseVersionsIT
Running org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.007 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT
org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT  Time elapsed: 0.006 
sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT.doSetup(ReadOnlyIndexFailureIT.java:116)
Caused by: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT.doSetup(ReadOnlyIndexFailureIT.java:116)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT.doSetup(ReadOnlyIndexFailureIT.java:116)

Running org.apache.phoenix.end2end.index.txn.TxWriteFailureIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.007 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.txn.TxWriteFailureIT
org.apache.phoenix.end2end.index.txn.TxWriteFailureIT  Time elapsed: 0.006 sec  
<<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.txn.TxWriteFailureIT.doSetup(TxWriteFailureIT.java:86)
Caused by: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.txn.TxWriteFailureIT.doSetup(TxWriteFailureIT.java:86)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.txn.TxWriteFailureIT.doSetup(TxWriteFailureIT.java:86)

Running org.apache.phoenix.execute.PartialCommitIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.009 sec <<< 
FAILURE! - in org.apache.phoenix.execute.PartialCommitIT
org.apache.phoenix.execute.PartialCommitIT  Time elapsed: 0.007 sec  <<< ERROR!

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

2016-03-28 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-2774 MemStoreScanner and KeyValueStore should not be aware of

[jtaylor] PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc

[jtaylor] PHOENIX-2760 Upgrade phoenix-server and phoenix-server-client to



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-2774 MemStoreScanner and KeyValueStore should not be aware of KeyValueScanner (Churro Morales)

2016-03-28 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 64fdf840b -> d07fed5e9


PHOENIX-2774 MemStoreScanner and KeyValueStore should not be aware of 
KeyValueScanner (Churro Morales)


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

Branch: refs/heads/master
Commit: d07fed5e997cfcbf48e09516716a919d5e3315cb
Parents: 64fdf84
Author: James Taylor 
Authored: Mon Mar 28 10:39:15 2016 -0700
Committer: James Taylor 
Committed: Mon Mar 28 10:39:15 2016 -0700

--
 .../apache/phoenix/hbase/index/covered/data/IndexMemStore.java  | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d07fed5e/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
index c7c5e3a..5b68fa2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
@@ -31,7 +31,6 @@ import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.regionserver.IndexKeyValueSkipListSet;
 import org.apache.hadoop.hbase.regionserver.MemStore;
 import org.apache.hadoop.hbase.util.Bytes;
-
 import org.apache.phoenix.hbase.index.covered.KeyValueStore;
 import org.apache.phoenix.hbase.index.covered.LocalTableState;
 import org.apache.phoenix.hbase.index.scanner.ReseekableScanner;
@@ -251,9 +250,7 @@ public class IndexMemStore implements KeyValueStore {
* Unfortunately the Java API does not offer a method to get it. So we 
remember the last keys
* we iterated to and restore the reseeked set to at least that point.
*/
-
-  KeyValue kv = KeyValueUtil.ensureKeyValue(key);
-  kvsetIt = kvsetAtCreation.tailSet(getHighest(kv, kvsetItRow)).iterator();
+  kvsetIt = 
kvsetAtCreation.tailSet(getHighest(KeyValueUtil.ensureKeyValue(key), 
kvsetItRow)).iterator();
   return seekInSubLists();
 }
 



[2/3] phoenix git commit: PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc (Sergey Soldatov)

2016-03-28 Thread jamestaylor
PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc (Sergey 
Soldatov)


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

Branch: refs/heads/4.x-HBase-1.0
Commit: c636504ed53f24a4aa2bef9def14d6fd439d66d1
Parents: 308e282
Author: James Taylor 
Authored: Mon Mar 28 08:22:37 2016 -0700
Committer: James Taylor 
Committed: Mon Mar 28 09:56:57 2016 -0700

--
 .../org/apache/phoenix/end2end/DateTimeIT.java  | 20 
 .../phoenix/expression/LiteralExpression.java   | 12 
 2 files changed, 24 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c636504e/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
index e87d8d4..af8f0c1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
@@ -513,6 +513,26 @@ public class DateTimeIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testUnsignedTimeDateWithLiteral() throws Exception {
+String ddl =
+"CREATE TABLE IF NOT EXISTS UT (k1 INTEGER NOT NULL," +
+"unsignedDates UNSIGNED_DATE, unsignedTimestamps 
UNSIGNED_TIMESTAMP, unsignedTimes UNSIGNED_TIME CONSTRAINT pk PRIMARY KEY 
(k1))";
+conn.createStatement().execute(ddl);
+String dml = "UPSERT INTO UT VALUES (1, " +
+"'2010-06-20 12:00:00', '2012-07-28 12:00:00', '2015-12-25 
12:00:00')";
+conn.createStatement().execute(dml);
+conn.commit();
+
+ResultSet rs = conn.createStatement().executeQuery("SELECT k1, 
unsignedDates, " +
+"unsignedTimestamps, unsignedTimes FROM UT where k1 = 1");
+assertTrue(rs.next());
+assertEquals(DateUtil.parseDate("2010-06-20 12:00:00"), rs.getDate(2));
+assertEquals(DateUtil.parseTimestamp("2012-07-28 12:00:00"), 
rs.getTimestamp(3));
+assertEquals(DateUtil.parseTime("2015-12-25 12:00:00"), rs.getTime(4));
+assertFalse(rs.next());
+}
+
+@Test
 public void testSecondFuncAgainstColumns() throws Exception {
 String ddl =
 "CREATE TABLE IF NOT EXISTS T1 (k1 INTEGER NOT NULL, dates 
DATE, timestamps TIMESTAMP, times TIME, " +

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c636504e/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
index ad1c7c0..90882a2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
@@ -25,6 +25,7 @@ import java.sql.SQLException;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.io.WritableUtils;
 import org.apache.phoenix.expression.visitor.ExpressionVisitor;
+import org.apache.phoenix.schema.IllegalDataException;
 import org.apache.phoenix.schema.SortOrder;
 import org.apache.phoenix.schema.TypeMismatchException;
 import org.apache.phoenix.schema.tuple.Tuple;
@@ -182,16 +183,11 @@ public class LiteralExpression extends 
BaseTerminalExpression {
 return getBooleanLiteralExpression((Boolean)value, determinism);
 }
 PDataType actualType = PDataType.fromLiteral(value);
-// For array we should check individual element in it?
-// It would be costly though!
-// UpsertStatement can try to cast varchar to date type but PVarchar 
can't CoercibleTo Date or Timestamp
-// otherwise TO_NUMBER like functions will fail
-if (!actualType.isCoercibleTo(type, value) &&
-(!actualType.equals(PVarchar.INSTANCE) ||
-!(type.equals(PDate.INSTANCE) || 
type.equals(PTimestamp.INSTANCE) || type.equals(PTime.INSTANCE {
+try {
+value = type.toObject(value, actualType);
+} catch (IllegalDataException e) {
 throw TypeMismatchException.newException(type, actualType, 
value.toString());
 }
-value = type.toObject(value, actualType);
 byte[] b = type.isArrayType() ? 

[1/3] phoenix git commit: PHOENIX-2774 MemStoreScanner and KeyValueStore should not be aware of KeyValueScanner (Churro Morales)

2016-03-28 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 e49ecec2b -> efa5a222d


PHOENIX-2774 MemStoreScanner and KeyValueStore should not be aware of 
KeyValueScanner (Churro Morales)


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 308e282c6d5a59dc64083b51abbe55456b707ec6
Parents: e49ecec
Author: James Taylor 
Authored: Mon Mar 28 09:04:49 2016 -0700
Committer: James Taylor 
Committed: Mon Mar 28 09:56:05 2016 -0700

--
 .../hbase/index/covered/KeyValueStore.java  |  4 +-
 .../hbase/index/covered/LocalTableState.java| 27 
 .../hbase/index/covered/data/IndexMemStore.java | 44 +++-
 .../index/scanner/FilteredKeyValueScanner.java  | 14 +++
 .../hbase/index/scanner/ReseekableScanner.java  | 28 +
 .../hbase/index/scanner/ScannerBuilder.java |  2 +-
 .../index/covered/data/TestIndexMemStore.java   |  6 +--
 7 files changed, 46 insertions(+), 79 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/308e282c/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
index 39f9062..30d2904 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
@@ -18,7 +18,7 @@
 package org.apache.phoenix.hbase.index.covered;
 
 import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.regionserver.KeyValueScanner;
+import org.apache.phoenix.hbase.index.scanner.ReseekableScanner;
 
 /**
  * Store a collection of KeyValues in memory.
@@ -27,7 +27,7 @@ public interface KeyValueStore {
 
   public void add(KeyValue kv, boolean overwrite);
 
-  public KeyValueScanner getScanner();
+  public ReseekableScanner getScanner();
 
   public void rollback(KeyValue kv);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/308e282c/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
index 2739cc2..3a7a7eb 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
@@ -194,33 +194,6 @@ public class LocalTableState implements TableState {
 return this.update.getRow();
 }
 
-public Result getCurrentRowState() {
-KeyValueScanner scanner = this.memstore.getScanner();
-List kvs = new ArrayList();
-while (scanner.peek() != null) {
-try {
-kvs.add(scanner.next());
-} catch (IOException e) {
-// this should never happen - something has gone terribly arwy 
if it has
-throw new RuntimeException("Local MemStore threw 
IOException!");
-}
-}
-return Result.create(kvs);
-}
-
-/**
- * Helper to add a {@link Mutation} to the values stored for the current 
row
- * 
- * @param pendingUpdate
- *update to apply
- */
-public void addUpdateForTesting(Mutation pendingUpdate) {
-for (Map.Entry e : 
pendingUpdate.getFamilyCellMap().entrySet()) {
-   List edits = 
KeyValueUtil.ensureKeyValues(e.getValue());
-addUpdate(edits);
-}
-}
-
 /**
  * @param hints
  */

http://git-wip-us.apache.org/repos/asf/phoenix/blob/308e282c/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
index 7ae54ad..eea1d00 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
@@ -17,7 +17,6 @@
  */
 

[1/3] phoenix git commit: PHOENIX-2774 MemStoreScanner and KeyValueStore should not be aware of KeyValueScanner (Churro Morales)

2016-03-28 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 57bd7988c -> cd492aea0


PHOENIX-2774 MemStoreScanner and KeyValueStore should not be aware of 
KeyValueScanner (Churro Morales)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: a62cde79d3ef48c199aa53867475b290e8d74c30
Parents: 57bd798
Author: James Taylor 
Authored: Mon Mar 28 09:04:49 2016 -0700
Committer: James Taylor 
Committed: Mon Mar 28 09:04:49 2016 -0700

--
 .../hbase/index/covered/KeyValueStore.java  |  4 +-
 .../hbase/index/covered/LocalTableState.java| 27 -
 .../hbase/index/covered/data/IndexMemStore.java | 60 +---
 .../index/scanner/FilteredKeyValueScanner.java  | 21 ---
 .../hbase/index/scanner/ReseekableScanner.java  | 28 +
 .../hbase/index/scanner/ScannerBuilder.java |  2 +-
 .../index/covered/data/TestIndexMemStore.java   |  7 +--
 7 files changed, 59 insertions(+), 90 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a62cde79/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
index 39f9062..30d2904 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java
@@ -18,7 +18,7 @@
 package org.apache.phoenix.hbase.index.covered;
 
 import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.regionserver.KeyValueScanner;
+import org.apache.phoenix.hbase.index.scanner.ReseekableScanner;
 
 /**
  * Store a collection of KeyValues in memory.
@@ -27,7 +27,7 @@ public interface KeyValueStore {
 
   public void add(KeyValue kv, boolean overwrite);
 
-  public KeyValueScanner getScanner();
+  public ReseekableScanner getScanner();
 
   public void rollback(KeyValue kv);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a62cde79/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
index 2739cc2..3a7a7eb 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/LocalTableState.java
@@ -194,33 +194,6 @@ public class LocalTableState implements TableState {
 return this.update.getRow();
 }
 
-public Result getCurrentRowState() {
-KeyValueScanner scanner = this.memstore.getScanner();
-List kvs = new ArrayList();
-while (scanner.peek() != null) {
-try {
-kvs.add(scanner.next());
-} catch (IOException e) {
-// this should never happen - something has gone terribly arwy 
if it has
-throw new RuntimeException("Local MemStore threw 
IOException!");
-}
-}
-return Result.create(kvs);
-}
-
-/**
- * Helper to add a {@link Mutation} to the values stored for the current 
row
- * 
- * @param pendingUpdate
- *update to apply
- */
-public void addUpdateForTesting(Mutation pendingUpdate) {
-for (Map.Entry e : 
pendingUpdate.getFamilyCellMap().entrySet()) {
-   List edits = 
KeyValueUtil.ensureKeyValues(e.getValue());
-addUpdate(edits);
-}
-}
-
 /**
  * @param hints
  */

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a62cde79/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
index 89489ec..7676134 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
@@ -17,24 +17,23 @@
  */
 package 

[2/3] phoenix git commit: PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc (Sergey Soldatov)

2016-03-28 Thread jamestaylor
PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc (Sergey 
Soldatov)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 338436b6dbca88038fdd25b14fcd90c06b13d1d3
Parents: a62cde7
Author: James Taylor 
Authored: Mon Mar 28 08:22:37 2016 -0700
Committer: James Taylor 
Committed: Mon Mar 28 09:05:14 2016 -0700

--
 .../org/apache/phoenix/end2end/DateTimeIT.java  | 20 
 .../phoenix/expression/LiteralExpression.java   | 12 
 2 files changed, 24 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/338436b6/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
index e87d8d4..af8f0c1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
@@ -513,6 +513,26 @@ public class DateTimeIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testUnsignedTimeDateWithLiteral() throws Exception {
+String ddl =
+"CREATE TABLE IF NOT EXISTS UT (k1 INTEGER NOT NULL," +
+"unsignedDates UNSIGNED_DATE, unsignedTimestamps 
UNSIGNED_TIMESTAMP, unsignedTimes UNSIGNED_TIME CONSTRAINT pk PRIMARY KEY 
(k1))";
+conn.createStatement().execute(ddl);
+String dml = "UPSERT INTO UT VALUES (1, " +
+"'2010-06-20 12:00:00', '2012-07-28 12:00:00', '2015-12-25 
12:00:00')";
+conn.createStatement().execute(dml);
+conn.commit();
+
+ResultSet rs = conn.createStatement().executeQuery("SELECT k1, 
unsignedDates, " +
+"unsignedTimestamps, unsignedTimes FROM UT where k1 = 1");
+assertTrue(rs.next());
+assertEquals(DateUtil.parseDate("2010-06-20 12:00:00"), rs.getDate(2));
+assertEquals(DateUtil.parseTimestamp("2012-07-28 12:00:00"), 
rs.getTimestamp(3));
+assertEquals(DateUtil.parseTime("2015-12-25 12:00:00"), rs.getTime(4));
+assertFalse(rs.next());
+}
+
+@Test
 public void testSecondFuncAgainstColumns() throws Exception {
 String ddl =
 "CREATE TABLE IF NOT EXISTS T1 (k1 INTEGER NOT NULL, dates 
DATE, timestamps TIMESTAMP, times TIME, " +

http://git-wip-us.apache.org/repos/asf/phoenix/blob/338436b6/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
index ad1c7c0..90882a2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
@@ -25,6 +25,7 @@ import java.sql.SQLException;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.io.WritableUtils;
 import org.apache.phoenix.expression.visitor.ExpressionVisitor;
+import org.apache.phoenix.schema.IllegalDataException;
 import org.apache.phoenix.schema.SortOrder;
 import org.apache.phoenix.schema.TypeMismatchException;
 import org.apache.phoenix.schema.tuple.Tuple;
@@ -182,16 +183,11 @@ public class LiteralExpression extends 
BaseTerminalExpression {
 return getBooleanLiteralExpression((Boolean)value, determinism);
 }
 PDataType actualType = PDataType.fromLiteral(value);
-// For array we should check individual element in it?
-// It would be costly though!
-// UpsertStatement can try to cast varchar to date type but PVarchar 
can't CoercibleTo Date or Timestamp
-// otherwise TO_NUMBER like functions will fail
-if (!actualType.isCoercibleTo(type, value) &&
-(!actualType.equals(PVarchar.INSTANCE) ||
-!(type.equals(PDate.INSTANCE) || 
type.equals(PTimestamp.INSTANCE) || type.equals(PTime.INSTANCE {
+try {
+value = type.toObject(value, actualType);
+} catch (IllegalDataException e) {
 throw TypeMismatchException.newException(type, actualType, 
value.toString());
 }
-value = type.toObject(value, actualType);
 byte[] b = type.isArrayType() ? 

[2/3] phoenix git commit: PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc (Sergey Soldatov)

2016-03-28 Thread jamestaylor
PHOENIX-2734 Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc (Sergey 
Soldatov)


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

Branch: refs/heads/master
Commit: d4d973c7b9fd5bb6bd206c9082c4c6d53e54c59b
Parents: bea110c
Author: James Taylor 
Authored: Mon Mar 28 08:22:37 2016 -0700
Committer: James Taylor 
Committed: Mon Mar 28 08:22:37 2016 -0700

--
 .../org/apache/phoenix/end2end/DateTimeIT.java  | 20 
 .../phoenix/expression/LiteralExpression.java   | 12 
 2 files changed, 24 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d4d973c7/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
index e87d8d4..af8f0c1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java
@@ -513,6 +513,26 @@ public class DateTimeIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testUnsignedTimeDateWithLiteral() throws Exception {
+String ddl =
+"CREATE TABLE IF NOT EXISTS UT (k1 INTEGER NOT NULL," +
+"unsignedDates UNSIGNED_DATE, unsignedTimestamps 
UNSIGNED_TIMESTAMP, unsignedTimes UNSIGNED_TIME CONSTRAINT pk PRIMARY KEY 
(k1))";
+conn.createStatement().execute(ddl);
+String dml = "UPSERT INTO UT VALUES (1, " +
+"'2010-06-20 12:00:00', '2012-07-28 12:00:00', '2015-12-25 
12:00:00')";
+conn.createStatement().execute(dml);
+conn.commit();
+
+ResultSet rs = conn.createStatement().executeQuery("SELECT k1, 
unsignedDates, " +
+"unsignedTimestamps, unsignedTimes FROM UT where k1 = 1");
+assertTrue(rs.next());
+assertEquals(DateUtil.parseDate("2010-06-20 12:00:00"), rs.getDate(2));
+assertEquals(DateUtil.parseTimestamp("2012-07-28 12:00:00"), 
rs.getTimestamp(3));
+assertEquals(DateUtil.parseTime("2015-12-25 12:00:00"), rs.getTime(4));
+assertFalse(rs.next());
+}
+
+@Test
 public void testSecondFuncAgainstColumns() throws Exception {
 String ddl =
 "CREATE TABLE IF NOT EXISTS T1 (k1 INTEGER NOT NULL, dates 
DATE, timestamps TIMESTAMP, times TIME, " +

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d4d973c7/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
index ad1c7c0..90882a2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/LiteralExpression.java
@@ -25,6 +25,7 @@ import java.sql.SQLException;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.io.WritableUtils;
 import org.apache.phoenix.expression.visitor.ExpressionVisitor;
+import org.apache.phoenix.schema.IllegalDataException;
 import org.apache.phoenix.schema.SortOrder;
 import org.apache.phoenix.schema.TypeMismatchException;
 import org.apache.phoenix.schema.tuple.Tuple;
@@ -182,16 +183,11 @@ public class LiteralExpression extends 
BaseTerminalExpression {
 return getBooleanLiteralExpression((Boolean)value, determinism);
 }
 PDataType actualType = PDataType.fromLiteral(value);
-// For array we should check individual element in it?
-// It would be costly though!
-// UpsertStatement can try to cast varchar to date type but PVarchar 
can't CoercibleTo Date or Timestamp
-// otherwise TO_NUMBER like functions will fail
-if (!actualType.isCoercibleTo(type, value) &&
-(!actualType.equals(PVarchar.INSTANCE) ||
-!(type.equals(PDate.INSTANCE) || 
type.equals(PTimestamp.INSTANCE) || type.equals(PTime.INSTANCE {
+try {
+value = type.toObject(value, actualType);
+} catch (IllegalDataException e) {
 throw TypeMismatchException.newException(type, actualType, 
value.toString());
 }
-value = type.toObject(value, actualType);
 byte[] b = type.isArrayType() ?