db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6131) select from view with "upper" and "in" list throws a ClassCastException
Date Wed, 03 Apr 2013 05:41:19 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13620641#comment-13620641

Mamta A. Satoor commented on DERBY-6131:

I reviewed the patch and the changes seems to be in line with the comment at the method level
which says
     * A predicate can be pushed into an underlying select if the source of 
     * every ColumnReference in the predicate is itself a ColumnReference.
So if the in list left operate is itself not a column reference, then it probably shoul not
be pused down. 

I have a question about the right operands of the in list. Currently we check if right operand
list is list of constant. If yes, then we go ahead and push the predicate. I am wondering
ifthat check should be changed to if the right operand list is a list of ColumnReference and
or Constants and if so then we should be able to push the predicate down. This can go as a
separate jira if it is the right thing to do.
> select from view with "upper" and "in" list throws a ClassCastException
> -----------------------------------------------------------------------
>                 Key: DERBY-6131
>                 URL: https://issues.apache.org/jira/browse/DERBY-6131
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:,,,,,,,,
>         Environment: windows
>            Reporter: Rong Qu
>            Assignee: Mike Matrigali
>         Attachments: derby-6131-patch.txt
> the issue can be reproduced
> 1. create table myTbl1 (name varchar(1000));
> 2. create table myTbl2 (name varchar(1000));
> 3. create view myView (name) as select t1.name from myTbl1 t1 union all select t2.name
from myTbl2 t2;
> 4. select name from myView where upper(name) in ('AA', 'BB');
> #4 failed with "org.apache.derby.impl.sql.compile.SimpleStringOperatorNode incompatible
with org.apache.derby.impl.sql.compile.ColumnReference: java.lang.ClassCastException"
> If the view is created as "create myView (name) as select t1.name from myTbl1 t1", the
query worked fine.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message