phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sama...@apache.org
Subject phoenix git commit: PHOENIX-1577 addendum - handle resultSet.getTimeStamp(int colIndex, Calendar cal) too
Date Wed, 11 Mar 2015 02:49:36 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.0 89df0eeba -> 04ceb5fe2


PHOENIX-1577 addendum - handle resultSet.getTimeStamp(int colIndex, Calendar cal) too


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

Branch: refs/heads/4.0
Commit: 04ceb5fe2e22b557546d63df092f78ce2044278d
Parents: 89df0ee
Author: Samarth <samarth.jain@salesforce.com>
Authored: Tue Mar 10 19:49:17 2015 -0700
Committer: Samarth <samarth.jain@salesforce.com>
Committed: Tue Mar 10 19:49:17 2015 -0700

----------------------------------------------------------------------
 .../apache/phoenix/end2end/TimezoneOffsetFunctionIT.java  |  3 +++
 .../java/org/apache/phoenix/jdbc/PhoenixResultSet.java    | 10 +---------
 2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/04ceb5fe/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
index 96142ed..6ff6357 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
@@ -179,6 +179,9 @@ public class TimezoneOffsetFunctionIT extends BaseHBaseManagedTimeIT {
         ResultSet rs = conn.createStatement().executeQuery(query);
         rs.next();
         assertEquals(new Timestamp(time), rs.getTimestamp(1));
+        assertEquals(new Timestamp(time), rs.getTimestamp("V"));
+        assertEquals(new Timestamp(time), rs.getTimestamp(1, cal));
+        assertEquals(new Timestamp(time), rs.getTimestamp("V", cal));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/04ceb5fe/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
index 7d91dbb..49e384c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java
@@ -652,15 +652,7 @@ public class PhoenixResultSet implements ResultSet, SQLCloseable, org.apache.pho
 
     @Override
     public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
-        checkCursorState();
-        Timestamp value = (Timestamp)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
-            PTimestamp.INSTANCE, ptr);
-        wasNull = (value == null);
-        if (value == null) {
-            return null;
-        }
-        cal.setTime(value); //this resets the millisecond part of timestamp according to
the time zone of the calendar.
-        return DateUtil.getTimestamp(cal.getTimeInMillis(), value.getNanos());
+        return getTimestamp(columnIndex);
     }
 
     @Override


Mime
View raw message