You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Alicia Ying Shu (JIRA)" <ji...@apache.org> on 2016/05/11 22:15:13 UTC

[jira] [Commented] (PHOENIX-2886) Union ALL with Char column not present in the table in Query 1 but in Query 2 throw exception

    [ https://issues.apache.org/jira/browse/PHOENIX-2886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15280911#comment-15280911 ] 

Alicia Ying Shu commented on PHOENIX-2886:
------------------------------------------

[~maryannxue] [~jamestaylor]  The culprit of the problem is that currently Union All uses the “schema” of the first query to construct the result template. The data type and length of the results returned from the 2nd queries (or the following queries) would be different. When I implemented Union All, I had proposed to pass down the “schema” with the result sets and evaluate it base on individual query during runtime. We did not choose my proposal. Would like to see your input on fixing this. Thanks. 

> Union ALL with Char column  not present in the table in Query 1 but in Query 2 throw exception
> ----------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2886
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2886
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Alicia Ying Shu
>            Assignee: Alicia Ying Shu
>
> To reproduce:
> create table person ( id bigint not null primary key, firstname char(10), lastname varchar(10) );
> upsert into person values( 1, 'john', 'doe');
> upsert into person values( 2, 'jane', 'doe');
> -- fixed value for char(10)
> select id, 'foo' firstname, lastname from person union all select * from person;
> java.lang.RuntimeException: java.sql.SQLException: ERROR 201 (22000): Illegal data. Expected length of at least 106 bytes, but had 13
> -- fixed value for bigint
> select cast( 10 AS bigint) id, 'foo' firstname, lastname from person union all select * from person;
> java.lang.RuntimeException: java.sql.SQLException: ERROR 201 (22000): Illegal data. Expected length of at least 106 bytes, but had 13



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)