phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-1696 Selecting column more than once fails (Maryann Xue, Samarth Jain)
Date Wed, 04 Mar 2015 16:34:33 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.3 90cd05e8f -> 97c4015a4


PHOENIX-1696 Selecting column more than once fails (Maryann Xue, Samarth Jain)


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

Branch: refs/heads/4.3
Commit: 97c4015a4aba172f50f4472436db739a62d66915
Parents: 90cd05e
Author: James Taylor <jtaylor@salesforce.com>
Authored: Wed Mar 4 08:27:51 2015 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Wed Mar 4 08:34:28 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/phoenix/end2end/QueryMoreIT.java  | 14 ++++++++++++++
 .../java/org/apache/phoenix/compile/RowProjector.java |  3 ---
 2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/97c4015a/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 af5e6fa..e725376 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
@@ -18,6 +18,8 @@
 package org.apache.phoenix.end2end;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.sql.Connection;
 import java.sql.Date;
@@ -33,6 +35,7 @@ import java.util.Properties;
 import org.apache.hadoop.hbase.util.Base64;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.phoenix.util.PhoenixRuntime;
+import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
 
 import com.google.common.collect.Lists;
@@ -314,4 +317,15 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
         sb.append(")");
         return sb.toString();
     }
+    
+    @Test // see - https://issues.apache.org/jira/browse/PHOENIX-1696
+    public void testSelectColumnMoreThanOnce() throws Exception {
+        Date date = new Date(System.currentTimeMillis());
+        initEntityHistoryTableValues("abcd", getDefaultSplits("abcd"), date, 100l);
+        String query = "SELECT NEW_VALUE, NEW_VALUE FROM " + TestUtil.ENTITY_HISTORY_TABLE_NAME
+ " LIMIT 1";
+        ResultSet rs = DriverManager.getConnection(getUrl()).createStatement().executeQuery(query);
+        assertTrue(rs.next());
+        rs.getObject("NEW_VALUE");
+        assertFalse(rs.next());
+    }
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/97c4015a/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java
index 364ebd6..1b35e92 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/RowProjector.java
@@ -139,9 +139,6 @@ public class RowProjector {
                 throw new ColumnNotFoundException(name);
             }
         }
-        if (index.size() > 1) {
-            throw new AmbiguousColumnException(name);
-        }
         
         return index.get(0);
     }


Mime
View raw message