phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject git commit: PHOENIX-116 Phoenix array integer types overlap with existing java.sql.Types (Gabriel Reid)
Date Sun, 09 Mar 2014 07:12:04 GMT
Repository: incubator-phoenix
Updated Branches:
  refs/heads/master 61805ebd4 -> 0da3a52b9


PHOENIX-116 Phoenix array integer types overlap with existing java.sql.Types (Gabriel Reid)


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

Branch: refs/heads/master
Commit: 0da3a52b9d4a4525837a834b2ebc6393f731f4d1
Parents: 61805eb
Author: James Taylor <jamestaylor@apache.org>
Authored: Sat Mar 8 23:11:57 2014 -0800
Committer: James Taylor <jamestaylor@apache.org>
Committed: Sat Mar 8 23:11:57 2014 -0800

----------------------------------------------------------------------
 .../phoenix/compile/ExpressionCompiler.java     |  3 +-
 .../expression/ArrayConstructorExpression.java  |  3 +-
 .../expression/function/ArrayIndexFunction.java |  3 +-
 .../function/ArrayLengthFunction.java           |  4 +-
 .../apache/phoenix/schema/PArrayDataType.java   | 15 +++---
 .../org/apache/phoenix/schema/PDataType.java    | 54 ++++++++++----------
 6 files changed, 39 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/0da3a52b/phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java
b/phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java
index f03c378..0c929c2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java
@@ -20,7 +20,6 @@ package org.apache.phoenix.compile;
 import java.math.BigDecimal;
 import java.sql.SQLException;
 import java.sql.SQLFeatureNotSupportedException;
-import java.sql.Types;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -1139,7 +1138,7 @@ public class ExpressionCompiler extends UnsupportedAllParseNodeVisitor<Expressio
             }
             Object value = PArrayDataType.instantiatePhoenixArray(arrayElemDataType, elements);
             return LiteralExpression.newConstant(value,
-                    PDataType.fromTypeId(arrayElemDataType.getSqlType() + Types.ARRAY), isDeterministic);
+                    PDataType.fromTypeId(arrayElemDataType.getSqlType() + PDataType.ARRAY_TYPE_BASE),
isDeterministic);
         }
         
         ArrayConstructorExpression arrayExpression = new ArrayConstructorExpression(children,
arrayElemDataType);

http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/0da3a52b/phoenix-core/src/main/java/org/apache/phoenix/expression/ArrayConstructorExpression.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/ArrayConstructorExpression.java
b/phoenix-core/src/main/java/org/apache/phoenix/expression/ArrayConstructorExpression.java
index 8f93247..008d267 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/ArrayConstructorExpression.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/ArrayConstructorExpression.java
@@ -13,7 +13,6 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.sql.Types;
 import java.util.Arrays;
 import java.util.List;
 
@@ -59,7 +58,7 @@ public class ArrayConstructorExpression extends BaseCompoundExpression {
 
     @Override
     public PDataType getDataType() {
-        return PDataType.fromTypeId(baseType.getSqlType() + Types.ARRAY);
+        return PDataType.fromTypeId(baseType.getSqlType() + PDataType.ARRAY_TYPE_BASE);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/0da3a52b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayIndexFunction.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayIndexFunction.java
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayIndexFunction.java
index a89b648..b96b7b5 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayIndexFunction.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayIndexFunction.java
@@ -17,7 +17,6 @@
  */
 package org.apache.phoenix.expression.function;
 
-import java.sql.Types;
 import java.util.List;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
@@ -74,7 +73,7 @@ public class ArrayIndexFunction extends ScalarFunction {
 	@Override
 	public PDataType getDataType() {
 		return PDataType.fromTypeId(children.get(0).getDataType().getSqlType()
-				- Types.ARRAY);
+				- PDataType.ARRAY_TYPE_BASE);
 	}
 	
 	@Override

http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/0da3a52b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayLengthFunction.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayLengthFunction.java
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayLengthFunction.java
index dd50942..941b1e3 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayLengthFunction.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayLengthFunction.java
@@ -17,11 +17,9 @@
  */
 package org.apache.phoenix.expression.function;
 
-import java.sql.Types;
 import java.util.List;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.parse.FunctionParseNode.Argument;
 import org.apache.phoenix.parse.FunctionParseNode.BuiltInFunction;
@@ -51,7 +49,7 @@ public class ArrayLengthFunction extends ScalarFunction {
 		}
 		PDataType baseType = PDataType.fromTypeId(children.get(0).getDataType()
 				.getSqlType()
-				- Types.ARRAY);
+				- PDataType.ARRAY_TYPE_BASE);
 		int length = PArrayDataType.getArrayLength(ptr, baseType);
 		byte[] lengthBuf = new byte[PDataType.INTEGER.getByteSize()];
 		PDataType.INTEGER.getCodec().encodeInt(length, lengthBuf, 0);

http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/0da3a52b/phoenix-core/src/main/java/org/apache/phoenix/schema/PArrayDataType.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PArrayDataType.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PArrayDataType.java
index 97c481e..d6d823d 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PArrayDataType.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PArrayDataType.java
@@ -20,7 +20,6 @@ package org.apache.phoenix.schema;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.sql.Types;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -53,7 +52,7 @@ public class PArrayDataType {
 		}
 		Pair<Integer, Integer> nullsVsNullRepeationCounter = new Pair<Integer, Integer>();
         int size = estimateByteSize(object, nullsVsNullRepeationCounter,
-                PDataType.fromTypeId((baseType.getSqlType() + Types.ARRAY)));
+                PDataType.fromTypeId((baseType.getSqlType() + PDataType.ARRAY_TYPE_BASE)));
         int noOfElements = ((PhoenixArray)object).numElements;
         if(noOfElements == 0) {
         	return ByteUtil.EMPTY_BYTE_ARRAY;
@@ -165,7 +164,7 @@ public class PArrayDataType {
         if (array == null || array.baseType == null) {
             return 0;
         }
-        return estimateByteSize(object, null, PDataType.fromTypeId((array.baseType.getSqlType()
+ Types.ARRAY)));
+        return estimateByteSize(object, null, PDataType.fromTypeId((array.baseType.getSqlType()
+ PDataType.ARRAY_TYPE_BASE)));
 	}
 
 	// Estimates the size of the given array and also calculates the number of nulls and its
repetition factor
@@ -180,7 +179,7 @@ public class PArrayDataType {
             int totalNulls = 0;
             for (int i = 0; i < noOfElements; i++) {
                 totalVarSize += array.estimateByteSize(i);
-                if (!PDataType.fromTypeId((baseType.getSqlType() - Types.ARRAY)).isFixedWidth())
{
+                if (!PDataType.fromTypeId((baseType.getSqlType() - PDataType.ARRAY_TYPE_BASE)).isFixedWidth())
{
                     if (array.isNull(i)) {
                         nulls++;
                     } else {
@@ -215,9 +214,9 @@ public class PArrayDataType {
 			return false;
 		} else {
 			PDataType targetElementType = PDataType.fromTypeId(targetType.getSqlType()
-					- Types.ARRAY);
+					- PDataType.ARRAY_TYPE_BASE);
 			PDataType expectedTargetElementType = PDataType.fromTypeId(expectedTargetType
-					.getSqlType() - Types.ARRAY);
+					.getSqlType() - PDataType.ARRAY_TYPE_BASE);
 			return expectedTargetElementType.isCoercibleTo(targetElementType);
 		}
     }
@@ -228,7 +227,7 @@ public class PArrayDataType {
 		PhoenixArray pArr = (PhoenixArray) value;
 		Object[] arr = (Object[]) pArr.array;
 		PDataType baseType = PDataType.fromTypeId(srcType.getSqlType()
-				- Types.ARRAY);
+				- PDataType.ARRAY_TYPE_BASE);
 		for (int i = 0 ; i < arr.length; i++) {
 			if (!baseType.isSizeCompatible(ptr, arr[i], baseType, srcType.getMaxLength(arr[i]),
 					scale, desiredMaxLength, desiredScale)) {
@@ -253,7 +252,7 @@ public class PArrayDataType {
 	    PhoenixArray pArr = (PhoenixArray) value;
         Object[] arr = (Object[]) pArr.array;
         PDataType baseType = PDataType.fromTypeId(actualType.getSqlType()
-                - Types.ARRAY);
+                - PDataType.ARRAY_TYPE_BASE);
         if (baseType.isFixedWidth()) {
             boolean createNewArray = false;
             for (int i = 0; i < arr.length; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/0da3a52b/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 22b987b..211b3b0 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
@@ -3176,7 +3176,7 @@ public enum PDataType {
             return VARBINARY.toStringLiteral(b, offset, length, formatter);
         }
     },
-    INTEGER_ARRAY("INTEGER_ARRAY", Types.ARRAY + PDataType.INTEGER.getSqlType(), PhoenixArray.class,
null) {
+    INTEGER_ARRAY("INTEGER_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.INTEGER.getSqlType(),
PhoenixArray.class, null) {
     	@Override
     	public boolean isArrayType() {
     		return true;
@@ -3240,7 +3240,7 @@ public enum PDataType {
 		}
 		
 	},
-    BOOLEAN_ARRAY("BOOLEAN_ARRAY", Types.ARRAY + PDataType.BOOLEAN.getSqlType(), PhoenixArray.class,
null) {
+    BOOLEAN_ARRAY("BOOLEAN_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.BOOLEAN.getSqlType(),
PhoenixArray.class, null) {
     	@Override
     	public boolean isArrayType() {
     		return true;
@@ -3305,7 +3305,7 @@ public enum PDataType {
 		}
 		
 	},
-	VARCHAR_ARRAY("VARCHAR_ARRAY", Types.ARRAY + PDataType.VARCHAR.getSqlType(), PhoenixArray.class,
null) {
+	VARCHAR_ARRAY("VARCHAR_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.VARCHAR.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -3382,7 +3382,7 @@ public enum PDataType {
         }
 		
 	},
-	VARBINARY_ARRAY("VARBINARY_ARRAY", Types.ARRAY + PDataType.VARBINARY.getSqlType(), PhoenixArray.class,
null) {
+	VARBINARY_ARRAY("VARBINARY_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.VARBINARY.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -3459,7 +3459,7 @@ public enum PDataType {
                     desiredScale, this);
         }
 	},
-	BINARY_ARRAY("BINARY_ARRAY", Types.ARRAY + PDataType.BINARY.getSqlType(), PhoenixArray.class,
null) {
+	BINARY_ARRAY("BINARY_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.BINARY.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -3537,7 +3537,7 @@ public enum PDataType {
         }
 
 	},
-	CHAR_ARRAY("CHAR_ARRAY", Types.ARRAY + PDataType.CHAR.getSqlType(), PhoenixArray.class,
null) {
+	CHAR_ARRAY("CHAR_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.CHAR.getSqlType(), PhoenixArray.class,
null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -3615,7 +3615,7 @@ public enum PDataType {
 		}
 		
 	},
-	LONG_ARRAY("LONG_ARRAY", Types.ARRAY + PDataType.LONG.getSqlType(), PhoenixArray.class,
null) {
+	LONG_ARRAY("LONG_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.LONG.getSqlType(), PhoenixArray.class,
null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -3678,7 +3678,7 @@ public enum PDataType {
         }
 		
 	},
-	SMALLINT_ARRAY("SMALLINT_ARRAY", Types.ARRAY + PDataType.SMALLINT.getSqlType(), PhoenixArray.class,
null) {
+	SMALLINT_ARRAY("SMALLINT_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.SMALLINT.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -3741,7 +3741,7 @@ public enum PDataType {
         }
 		
 	},
-	TINYINT_ARRAY("TINYINT_ARRAY", Types.ARRAY + PDataType.TINYINT.getSqlType(), PhoenixArray.class,
null) {
+	TINYINT_ARRAY("TINYINT_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.TINYINT.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -3804,7 +3804,7 @@ public enum PDataType {
         }
 		
 	},
-	FLOAT_ARRAY("FLOAT_ARRAY", Types.ARRAY + PDataType.FLOAT.getSqlType(), PhoenixArray.class,
null) {
+	FLOAT_ARRAY("FLOAT_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.FLOAT.getSqlType(), PhoenixArray.class,
null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -3868,7 +3868,7 @@ public enum PDataType {
         }
 		
 	},
-	DOUBLE_ARRAY("DOUBLE_ARRAY", Types.ARRAY + PDataType.DOUBLE.getSqlType(), PhoenixArray.class,
null) {
+	DOUBLE_ARRAY("DOUBLE_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.DOUBLE.getSqlType(),
PhoenixArray.class, null) {
 	    final PArrayDataType pDataTypeForArray = new PArrayDataType();
 		@Override
     	public boolean isArrayType() {
@@ -3933,7 +3933,7 @@ public enum PDataType {
 
 	},
 	
-	DECIMAL_ARRAY("DECIMAL_ARRAY", Types.ARRAY + PDataType.DECIMAL.getSqlType(), PhoenixArray.class,
null) {
+	DECIMAL_ARRAY("DECIMAL_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.DECIMAL.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -4004,7 +4004,7 @@ public enum PDataType {
 		}
 	
 	},
-	TIMESTAMP_ARRAY("TIMESTAMP_ARRAY", Types.ARRAY + PDataType.TIMESTAMP.getSqlType(), PhoenixArray.class,
+	TIMESTAMP_ARRAY("TIMESTAMP_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.TIMESTAMP.getSqlType(),
PhoenixArray.class,
 			null) {
 		@Override
     	public boolean isArrayType() {
@@ -4068,7 +4068,7 @@ public enum PDataType {
         }
 
 	},
-	UNSIGNED_TIMESTAMP_ARRAY("UNSIGNED_TIMESTAMP_ARRAY", Types.ARRAY + PDataType.UNSIGNED_TIMESTAMP.getSqlType(),
PhoenixArray.class,
+	UNSIGNED_TIMESTAMP_ARRAY("UNSIGNED_TIMESTAMP_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_TIMESTAMP.getSqlType(),
PhoenixArray.class,
 			null) {
 		@Override
     	public boolean isArrayType() {
@@ -4132,7 +4132,7 @@ public enum PDataType {
         }
 
 	},
-	TIME_ARRAY("TIME_ARRAY", Types.ARRAY + PDataType.TIME.getSqlType(), PhoenixArray.class,
null) {
+	TIME_ARRAY("TIME_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.TIME.getSqlType(), PhoenixArray.class,
null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -4195,7 +4195,7 @@ public enum PDataType {
         }
 
 	},
-	UNSIGNED_TIME_ARRAY("UNSIGNED_TIME_ARRAY", Types.ARRAY + PDataType.UNSIGNED_TIME.getSqlType(),
PhoenixArray.class, null) {
+	UNSIGNED_TIME_ARRAY("UNSIGNED_TIME_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_TIME.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -4258,7 +4258,7 @@ public enum PDataType {
         }
 
 	},
-	DATE_ARRAY("DATE_ARRAY", Types.ARRAY + PDataType.DATE.getSqlType(), PhoenixArray.class,
null) {
+	DATE_ARRAY("DATE_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.DATE.getSqlType(), PhoenixArray.class,
null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -4321,7 +4321,7 @@ public enum PDataType {
         }
 
 	},
-	UNSIGNED_DATE_ARRAY("UNSIGNED_DATE_ARRAY", Types.ARRAY + PDataType.UNSIGNED_DATE.getSqlType(),
PhoenixArray.class, null) {
+	UNSIGNED_DATE_ARRAY("UNSIGNED_DATE_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_DATE.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -4384,7 +4384,7 @@ public enum PDataType {
         }
 
 	},
-	UNSIGNED_LONG_ARRAY("UNSIGNED_LONG_ARRAY", Types.ARRAY + PDataType.UNSIGNED_LONG.getSqlType(),
PhoenixArray.class, null) {
+	UNSIGNED_LONG_ARRAY("UNSIGNED_LONG_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_LONG.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -4447,7 +4447,7 @@ public enum PDataType {
         }
 	
 	},
-	UNSIGNED_INT_ARRAY("UNSIGNED_INT_ARRAY", Types.ARRAY + PDataType.UNSIGNED_INT.getSqlType(),
PhoenixArray.class, null) {
+	UNSIGNED_INT_ARRAY("UNSIGNED_INT_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_INT.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -4510,7 +4510,7 @@ public enum PDataType {
         }
 
 	},
-	UNSIGNED_SMALLINT_ARRAY("UNSIGNED_SMALLINT_ARRAY", Types.ARRAY + PDataType.UNSIGNED_SMALLINT.getSqlType(),
+	UNSIGNED_SMALLINT_ARRAY("UNSIGNED_SMALLINT_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_SMALLINT.getSqlType(),
 			PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
@@ -4574,7 +4574,7 @@ public enum PDataType {
         }
 
 	},
-	UNSIGNED_TINYINT_ARRAY("UNSIGNED_TINYINT__ARRAY", Types.ARRAY + PDataType.UNSIGNED_TINYINT.getSqlType(),
PhoenixArray.class,
+	UNSIGNED_TINYINT_ARRAY("UNSIGNED_TINYINT__ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_TINYINT.getSqlType(),
PhoenixArray.class,
 			null) {
 		@Override
     	public boolean isArrayType() {
@@ -4637,7 +4637,7 @@ public enum PDataType {
            return true;
         }
 	},
-	UNSIGNED_FLOAT_ARRAY("UNSIGNED_FLOAT_ARRAY", Types.ARRAY + PDataType.UNSIGNED_FLOAT.getSqlType(),
PhoenixArray.class, null) {
+	UNSIGNED_FLOAT_ARRAY("UNSIGNED_FLOAT_ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_FLOAT.getSqlType(),
PhoenixArray.class, null) {
 		@Override
     	public boolean isArrayType() {
     		return true;
@@ -4700,7 +4700,7 @@ public enum PDataType {
         }
 
 	},
-	UNSIGNED_DOUBLE_ARRAY("UNSIGNED_DOUBLE__ARRAY", Types.ARRAY + PDataType.UNSIGNED_DOUBLE.getSqlType(),
PhoenixArray.class,
+	UNSIGNED_DOUBLE_ARRAY("UNSIGNED_DOUBLE__ARRAY", PDataType.ARRAY_TYPE_BASE + PDataType.UNSIGNED_DOUBLE.getSqlType(),
PhoenixArray.class,
 			null) {
 		@Override
     	public boolean isArrayType() {
@@ -5992,6 +5992,8 @@ public enum PDataType {
     public final static Integer SHORT_PRECISION = 5;
     public final static Integer BYTE_PRECISION = 3;
 
+    public static final int ARRAY_TYPE_BASE = 3000;
+    
     /**
      * Serialize a BigDecimal into a variable length byte array in such a way that it is
      * binary comparable.
@@ -6412,7 +6414,7 @@ public enum PDataType {
     
     public static int sqlArrayType(String sqlTypeName) {
     	PDataType fromSqlTypeName = fromSqlTypeName(sqlTypeName);
-    	return fromSqlTypeName.getSqlType() + Types.ARRAY;
+    	return fromSqlTypeName.getSqlType() + PDataType.ARRAY_TYPE_BASE;
     }
 
     private static final int SQL_TYPE_OFFSET;
@@ -6557,7 +6559,7 @@ public enum PDataType {
 		for (PDataType type : PDataType.values()) {
 			if (type.isArrayType()) {
 				PhoenixArray arr = (PhoenixArray) value;
-				if ((type.getSqlType() == arr.baseType.sqlType + Types.ARRAY)
+				if ((type.getSqlType() == arr.baseType.sqlType + PDataType.ARRAY_TYPE_BASE)
 						&& type.getJavaClass().isInstance(value)) {
 					return type;
 				}


Mime
View raw message