phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [3/3] git commit: PHOENIX-835 Datatype statements in CAST operations are case-sensitive (GabrielReid)
Date Tue, 11 Mar 2014 23:08:09 GMT
PHOENIX-835 Datatype statements in CAST operations are case-sensitive (GabrielReid)


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

Branch: refs/heads/3.0
Commit: bffba7a3f9e732be07cb96ad4afe435e003947e6
Parents: 7c942bb
Author: jamestaylor <jamestaylor@apache.org>
Authored: Tue Mar 11 16:05:51 2014 -0700
Committer: jamestaylor <jamestaylor@apache.org>
Committed: Tue Mar 11 16:05:51 2014 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/parse/CastParseNode.java     | 3 ++-
 .../src/test/java/org/apache/phoenix/end2end/QueryTest.java       | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/bffba7a3/phoenix-core/src/main/java/org/apache/phoenix/parse/CastParseNode.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/CastParseNode.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/CastParseNode.java
index 3cda048..9bc2b41 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/parse/CastParseNode.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/CastParseNode.java
@@ -26,6 +26,7 @@ import org.apache.phoenix.expression.function.RoundDecimalExpression;
 import org.apache.phoenix.expression.function.RoundTimestampExpression;
 import org.apache.phoenix.schema.PDataType;
 import org.apache.phoenix.schema.TypeMismatchException;
+import org.apache.phoenix.util.SchemaUtil;
 
 /**
  * 
@@ -41,7 +42,7 @@ public class CastParseNode extends UnaryParseNode {
 	
 	CastParseNode(ParseNode expr, String dataType) {
 		super(expr);
-		dt = PDataType.fromSqlTypeName(dataType);
+		dt = PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(dataType));
 	}
 	
 	CastParseNode(ParseNode expr, PDataType dataType) {

http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/bffba7a3/phoenix-core/src/test/java/org/apache/phoenix/end2end/QueryTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/end2end/QueryTest.java b/phoenix-core/src/test/java/org/apache/phoenix/end2end/QueryTest.java
index d5b1b51..69815bb 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/end2end/QueryTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/end2end/QueryTest.java
@@ -2766,7 +2766,7 @@ public class QueryTest extends BaseClientManagedTimeTest {
     
     @Test
     public void testCastOperatorInSelect() throws Exception {
-        String query = "SELECT CAST(a_integer AS DECIMAL)/2 FROM aTable WHERE ?=organization_id
and 5=a_integer";
+        String query = "SELECT CAST(a_integer AS decimal)/2 FROM aTable WHERE ?=organization_id
and 5=a_integer";
         Properties props = new Properties(TEST_PROPERTIES);
         props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 2)); // Execute
at timestamp 2
         Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, props);


Mime
View raw message