You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Lars Hofhansl (Jira)" <ji...@apache.org> on 2021/03/20 06:02:00 UTC

[jira] [Commented] (PHOENIX-6423) Mixing default and explicit column families causes exceptions and wrong results.

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

Lars Hofhansl commented on PHOENIX-6423:
----------------------------------------

Marking as "major" since this leads to incorrect "*" queries.

The problem is here in the ProjectionCompiler (line 146):
{code}
            PColumn column = table.getColumns().get(i);
            // Skip tenant ID column (which may not be the first column, but is the first PK column)
            if (SchemaUtil.isPKColumn(column) && j++ < minPKOffset) {
                posOffset++;
                continue;
            }
            ColumnRef ref = new ColumnRef(tableRef,i);
            String colName = ref.getColumn().getName().getString();
{code}

This loses the column family information.

> Mixing default and explicit column families causes exceptions and wrong results.
> --------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6423
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6423
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>            Priority: Major
>
> This one is obscure:
> {code}
> > create table test3(pk1 integer not null primary key, v1 float, y.v1 varchar);
> No rows affected (1.179 seconds)
> > create local index l4 on test3(v1);         
> No rows affected (11.253 seconds)
> > select * from test3 where v1 < 1;
> Error: ERROR 203 (22005): Type mismatch. expected: FLOAT but was: VARCHAR at column: V1 (state=22005,code=203)
> org.apache.phoenix.schema.ArgumentTypeMismatchException: ERROR 203 (22005): Type mismatch. expected: FLOAT but was: VARCHAR at column: V1
> at org.apache.phoenix.compile.ProjectionCompiler.coerceIfNecessary(ProjectionCompiler.java:339)
> at org.apache.phoenix.compile.ProjectionCompiler.projectAllIndexColumns(ProjectionCompiler.java:258)
> at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:393)
> at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:757)
> at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:676)
> at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:253)
> at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:178)
> at org.apache.phoenix.optimize.QueryOptimizer.addPlan(QueryOptimizer.java:347)
> at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlansForSingleFlatQuery(QueryOptimizer.java:239)
> at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:138)
> at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:116)
> at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:102)
> at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:313)
> at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:295)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:294)
> at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:287)
> at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1930)
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)