[
https://issues.apache.org/jira/browse/PHOENIX-3879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16022157#comment-16022157
]
Thomas D'Silva commented on PHOENIX-3879:
-----------------------------------------
[~jamestaylor]
The union query was failing because in ProjectionCompiler.compile() we
calculate the estimatedByteSize for fixed width columns by using the the max
length (which was null since the FirstLastValueBaseFunction did not implement
it).
{code}
PColumn column = family.getPColumnForColumnQualifier(cq);
Integer maxLength = column.getMaxLength();
int byteSize = column.getDataType().isFixedWidth() ? maxLength == null ?
column.getDataType().getByteSize()
: maxLength :
RowKeySchema.ESTIMATED_VARIABLE_LENGTH_SIZE;
estimatedByteSize += SizedUtil.KEY_VALUE_SIZE + estimatedKeySize + byteSize;
{code}
I tested a union query with an aggregate function on a DECIMAL column and it
works.
> UNION ALL with subqueries that have aggregate functions on fixed length
> columns throw an NPE
> --------------------------------------------------------------------------------------------
>
> Key: PHOENIX-3879
> URL: https://issues.apache.org/jira/browse/PHOENIX-3879
> Project: Phoenix
> Issue Type: Bug
> Reporter: Thomas D'Silva
> Assignee: Thomas D'Silva
> Fix For: 4.11.0
>
> Attachments: PHOENIX-3879.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)