git commit: PHOENIX-1037 ResultSetSqlType for date/time types

2014-06-12 Thread greid
Repository: phoenix
Updated Branches:
  refs/heads/master e9f895f69 - 58b2a79e5


PHOENIX-1037 ResultSetSqlType for date/time types

Add implementations of getResultSetSqlType for unsigned
date/time/timestamp types


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

Branch: refs/heads/master
Commit: 58b2a79e5c803a1c9777f4a0c33bc70a1b605f81
Parents: e9f895f
Author: Gabriel Reid gabri...@ngdata.com
Authored: Tue Jun 10 23:37:11 2014 +0200
Committer: Gabriel Reid gabri...@ngdata.com
Committed: Thu Jun 12 21:11:21 2014 +0200

--
 .../java/org/apache/phoenix/schema/PDataType.java| 15 +++
 .../org/apache/phoenix/schema/PDataTypeTest.java |  6 ++
 2 files changed, 21 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/58b2a79e/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
index d886c39..c7697bf 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
@@ -2143,6 +2143,11 @@ public enum PDataType {
 long millis = 
PDataType.UNSIGNED_LONG.getCodec().decodeLong(ptr.get(),ptr.getOffset(), 
sortOrder);
 return millis;
 }
+
+@Override
+public int getResultSetSqlType() {
+return Types.TIMESTAMP;
+}
 },
 UNSIGNED_TIME(UNSIGNED_TIME, 18, Time.class, new UnsignedDateCodec()) {
 
@@ -2214,6 +2219,11 @@ public enum PDataType {
 public String toStringLiteral(byte[] b, int offset, int length, Format 
formatter) {
 return UNSIGNED_DATE.toStringLiteral(b, offset, length, formatter);
 }
+
+@Override
+public int getResultSetSqlType() {
+return Types.TIME;
+}
 },
 UNSIGNED_DATE(UNSIGNED_DATE, 19, Date.class, new UnsignedDateCodec()) { 
// After TIMESTAMP and DATE to ensure toLiteral finds those first
 
@@ -2312,6 +2322,11 @@ public enum PDataType {
 }
 super.coerceBytes(ptr, object, actualType, maxLength, scale, 
actualModifier, desiredMaxLength, desiredScale, expectedModifier);
 }
+
+@Override
+public int getResultSetSqlType() {
+return Types.DATE;
+}
 },
 /**
  * Unsigned long type that restricts values to be from 0 to {@link 
java.lang.Long#MAX_VALUE} inclusive. May be used to map to existing HTable 
values created through {@link org.apache.hadoop.hbase.util.Bytes#toBytes(long)}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/58b2a79e/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java
index f3a7349..d6709b6 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java
@@ -1574,6 +1574,12 @@ public class PDataTypeTest {
 assertEquals(Types.FLOAT, 
PDataType.UNSIGNED_FLOAT.getResultSetSqlType());
 assertEquals(Types.DOUBLE, PDataType.DOUBLE.getResultSetSqlType());
 assertEquals(Types.DOUBLE, 
PDataType.UNSIGNED_DOUBLE.getResultSetSqlType());
+assertEquals(Types.DATE, PDataType.DATE.getResultSetSqlType());
+assertEquals(Types.DATE, 
PDataType.UNSIGNED_DATE.getResultSetSqlType());
+assertEquals(Types.TIME, PDataType.TIME.getResultSetSqlType());
+assertEquals(Types.TIME, 
PDataType.UNSIGNED_TIME.getResultSetSqlType());
+assertEquals(Types.TIMESTAMP, 
PDataType.TIMESTAMP.getResultSetSqlType());
+assertEquals(Types.TIMESTAMP, 
PDataType.UNSIGNED_TIMESTAMP.getResultSetSqlType());
 
 // Check that all array types are defined as java.sql.Types.ARRAY
 for (PDataType dataType : PDataType.values()) {



git commit: PHOENIX-1037 ResultSetSqlType for date/time types

2014-06-12 Thread greid
Repository: phoenix
Updated Branches:
  refs/heads/3.0 6afce315e - d29254079


PHOENIX-1037 ResultSetSqlType for date/time types

Add implementations of getResultSetSqlType for unsigned
date/time/timestamp types


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

Branch: refs/heads/3.0
Commit: d292540797595749132f1d9d88a75488d7517105
Parents: 6afce31
Author: Gabriel Reid gabri...@ngdata.com
Authored: Tue Jun 10 23:37:11 2014 +0200
Committer: Gabriel Reid gabri...@ngdata.com
Committed: Thu Jun 12 21:33:13 2014 +0200

--
 .../java/org/apache/phoenix/schema/PDataType.java| 15 +++
 .../org/apache/phoenix/schema/PDataTypeTest.java |  6 ++
 2 files changed, 21 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d2925407/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
index d886c39..c7697bf 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PDataType.java
@@ -2143,6 +2143,11 @@ public enum PDataType {
 long millis = 
PDataType.UNSIGNED_LONG.getCodec().decodeLong(ptr.get(),ptr.getOffset(), 
sortOrder);
 return millis;
 }
+
+@Override
+public int getResultSetSqlType() {
+return Types.TIMESTAMP;
+}
 },
 UNSIGNED_TIME(UNSIGNED_TIME, 18, Time.class, new UnsignedDateCodec()) {
 
@@ -2214,6 +2219,11 @@ public enum PDataType {
 public String toStringLiteral(byte[] b, int offset, int length, Format 
formatter) {
 return UNSIGNED_DATE.toStringLiteral(b, offset, length, formatter);
 }
+
+@Override
+public int getResultSetSqlType() {
+return Types.TIME;
+}
 },
 UNSIGNED_DATE(UNSIGNED_DATE, 19, Date.class, new UnsignedDateCodec()) { 
// After TIMESTAMP and DATE to ensure toLiteral finds those first
 
@@ -2312,6 +2322,11 @@ public enum PDataType {
 }
 super.coerceBytes(ptr, object, actualType, maxLength, scale, 
actualModifier, desiredMaxLength, desiredScale, expectedModifier);
 }
+
+@Override
+public int getResultSetSqlType() {
+return Types.DATE;
+}
 },
 /**
  * Unsigned long type that restricts values to be from 0 to {@link 
java.lang.Long#MAX_VALUE} inclusive. May be used to map to existing HTable 
values created through {@link org.apache.hadoop.hbase.util.Bytes#toBytes(long)}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d2925407/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java
index f3a7349..d6709b6 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/schema/PDataTypeTest.java
@@ -1574,6 +1574,12 @@ public class PDataTypeTest {
 assertEquals(Types.FLOAT, 
PDataType.UNSIGNED_FLOAT.getResultSetSqlType());
 assertEquals(Types.DOUBLE, PDataType.DOUBLE.getResultSetSqlType());
 assertEquals(Types.DOUBLE, 
PDataType.UNSIGNED_DOUBLE.getResultSetSqlType());
+assertEquals(Types.DATE, PDataType.DATE.getResultSetSqlType());
+assertEquals(Types.DATE, 
PDataType.UNSIGNED_DATE.getResultSetSqlType());
+assertEquals(Types.TIME, PDataType.TIME.getResultSetSqlType());
+assertEquals(Types.TIME, 
PDataType.UNSIGNED_TIME.getResultSetSqlType());
+assertEquals(Types.TIMESTAMP, 
PDataType.TIMESTAMP.getResultSetSqlType());
+assertEquals(Types.TIMESTAMP, 
PDataType.UNSIGNED_TIMESTAMP.getResultSetSqlType());
 
 // Check that all array types are defined as java.sql.Types.ARRAY
 for (PDataType dataType : PDataType.values()) {



Apache-Phoenix | 4.0 | Hadoop1 | Build Successful

2014-06-12 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
[gabrielr] PHOENIX-1037 ResultSetSqlType for date/time types