Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/18#discussion_r10581965
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/parse/CastParseNode.java ---
    @@ -40,14 +40,23 @@
        
        private final PDataType dt;
        
    -   CastParseNode(ParseNode expr, String dataType) {
    +   CastParseNode(ParseNode expr, String dataType, boolean arr) {
                super(expr);
    -           dt = 
PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(dataType));
    +           if(arr == true) {
    +               PDataType baseType = 
PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(dataType));
    +               dt = PDataType.fromTypeId(baseType.getSqlType() + 
PDataType.ARRAY_TYPE_BASE);
    +           } else {
    +               dt = 
PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(dataType));
    +           }
        }
        
    -   CastParseNode(ParseNode expr, PDataType dataType) {
    -           super(expr);
    -           dt = dataType;
    +   CastParseNode(ParseNode expr, PDataType dataType, boolean arr) {
    +        super(expr);
    +        if (arr == true) {
    --- End diff --
    
    Please put this logic in a separate init() method. Then call it here plus 
at the end of readFields, after the super.readFields() call. Otherwise, it 
won't get executed when this expression is used on the server-side, as the 
server-side uses the empty arg constructor.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to