[ 
http://jira.codehaus.org/browse/GEOT-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jody Garnett reopened GEOT-2574:
--------------------------------


The resulting build fails on osx and win32. We spent an hour on IRC and were 
unable to sort out what the problem was.

Since it has now been one day; and we have not been able to find you for a 
debugging session it is time to back out your patch.

Your work has been removed as of -r25776; I will attach a reverse patch (or you 
can simply refer to this revision number to recover your work).


> fid filter may be ambiguous if there's an actual attribute named ID
> -------------------------------------------------------------------
>
>                 Key: GEOT-2574
>                 URL: http://jira.codehaus.org/browse/GEOT-2574
>             Project: GeoTools
>          Issue Type: Improvement
>          Components: core cql
>    Affects Versions: 2.5.6
>            Reporter: Gabriel Roldán
>            Assignee: Mauricio Pazos
>             Fix For: 2.7-RC1
>
>
> The ECQL grammar does not allow to create an IN filter on an attribute called 
> ID: {{ID IN (1, 2, 3)}} is meant as a fid filter.
> Some time ago it was proposed that the fid filter were created through a 
> special token {...@id}} instead: 
> [http://www.mail-archive.com/[email protected]/msg07018.html].
> The following test case exemplifies it:
> {code}
> Index: src/test/java/org/geotools/filter/text/ecql/ECQLINPredicateTest.java
> ===================================================================
> --- src/test/java/org/geotools/filter/text/ecql/ECQLINPredicateTest.java      
> (revision 33330)
> +++ src/test/java/org/geotools/filter/text/ecql/ECQLINPredicateTest.java      
> (working copy)
> @@ -17,6 +17,7 @@
>  
>  package org.geotools.filter.text.ecql;
>  
> +import java.util.Arrays;
>  import java.util.Iterator;
>  import java.util.LinkedList;
>  import java.util.List;
> @@ -46,6 +47,25 @@
>   
>      
>      /**
> +     * Say there's an attribute named "ID" and you want to build an IN 
> filter on it...
> +     * sample: ID IN (1,2,3)
> +     * @throws CQLException 
> +     */
> +    @Test
> +    public void idAttribtueInList() throws CQLException{
> +
> +        List<String> intList = Arrays.asList("1", "2", "3");
> +        String propName = "ID";
> +        final String txtPredicate = makeInPredicate(propName, intList);
> +
> +        Filter filter = ECQL.toFilter( txtPredicate);
> +        
> +        commonAssertForInPredicate(filter);
> +        
> +        assertFilterHasProperty((Or)filter, propName);
> +    }
> +
> +    /**
>       * sample: length IN (4100001)
>       * @throws CQLException 
>       */
> {code}
> and produces the parse error:
> {panel}
> org.geotools.filter.text.cql2.CQLException: Encountered "ID IN ( 1" at line 
> 1, column 1.
> Was expecting one of:
>     <NOT> ...
>     "(" ...
>     "[" ...
>     <IDENTIFIER> ...
>     "-" ...
>     <INTEGER_LITERAL> ...
>     <FLOATING_LITERAL> ...
>     <STRING_LITERAL> ...
>     "true" ...
>     "false" ...
>     "point" ...
>     "linestring" ...
>     "polygon" ...
>     "multipoint" ...
>     "multilinestring" ...
>     "multipolygon" ...
>     "geometrycollection" ...
>     "envelope" ...
>     "id" ...
>     "id" <NOT> ...
>     "id" "in" "(" <STRING_LITERAL> ...
>     "include" ...
>     "exclude" ...
>     . Parsing : ID IN (1,2,3). Current Token : "null"
>       at 
> org.geotools.filter.text.ecql.ECQLCompiler.compileFilter(ECQLCompiler.java:96)
> ...
> {panel}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to