I imagine if we review the gammer we can allow the use of "t" as an
expression (rather than denoting a filter). I am not sure how far the
grammar looks ahead but we should be able to figure it out.
Ian are you sure you can quotes to define a property name? If so we should
fix the toCQL function to quote 't' as a special case (I am sure it would
check for property names with a space so there should be some special case
logic already).
--
Jody Garnett
On 8 May 2017 at 09:14, Jim Hughes <jn...@ccri.com> wrote:
> Seems like there are two options: 1. Figure out if JJTree can handle
> tokens being re-used as attributes, 2. As Suresh suggested, provide a way
> to let users know that their attribute name may be a reserved keyword.
>
> As a second issue, in GeoMesa, we are using CQL as representation of what
> filtering to apply. As such, we pass around CQL filters as both strings
> and Java objects. For distributed communication, the string "ECQL.toCQL"
> representation is used. On the other machines, ECQL.toFilter is called.
>
> Basically, this assumes that ECQL.toFilter(ECQL.toCQL(filter)) is more or
> less the 'identity' function. Ian's suggestion to use double quotes are
> stripped by this process...
>
> To cover this use case, there may need to be an ECQL.toSafeCQL function
> created. (I'm halfway volunteering.) Thoughts?
>
> Jim
>
>
> On 05/07/2017 12:21 PM, Jody Garnett wrote:
>
> so what is the conflict? is "t" a representation of true or something? Oh
> I see it is conflicting with a time representation .. what can be done
> about that?
>
> --
> Jody Garnett
>
> On 7 May 2017 at 02:52, Ian Turton <ijtur...@gmail.com> wrote:
>
>> I've put this in a bug report https://osgeo-org.atlas
>> sian.net/browse/GEOT-5722 so we don't forget about it - current best
>> work around is to quote the attribute name or use a longer name
>>
>> Ian
>>
>>
>>
>> On 7 May 2017 at 09:22, Suresh Prajapati <sureshpraja1...@gmail.com>
>> wrote:
>>
>>> Hello everyone,
>>>
>>> I am querying a simple feature type schema:
>>> r:Long:index=join,*g:Point:srid=4326,di:Integer:index=join,a
>>> l:Float,s:Float,b:Float,an:Float,he:Float,ve:Float,t:Float,m
>>> :Boolean,i:Boolean,ts:Long;geomesa.table.sharing='true',geom
>>> esa.indices='attr:4:3,records:2:3,z2:3:3',geomesa.table.shar
>>> ing.prefix='\\u0001'
>>>
>>> with the query expression: r = 31 AND di = 5 AND BBOX(g, -38.857822,
>>> -76.111145, -74.64091, -38.61907) AND al <= 39.407307 AND s <= 1.6442835
>>> AND b <= 83.14717 AND an <= 87.0774 AND he <= 40.89476 AND ve <= 88.761566
>>> AND t <= 44.786507 AND m = true AND i = true.
>>>
>>> but it throws an exception saying Encountered "t" at line 1, column 195.
>>>
>>> Here is my exception log detail:
>>>
>>> org.geotools.filter.text.cql2.CQLException: Encountered "t" at line 1,
>>> column 195.
>>> Was expecting one of:
>>> <NOT> ...
>>> <IDENTIFIER> ...
>>> "include" ...
>>> "exclude" ...
>>> "(" ...
>>> "[" ...
>>> Parsing : r = 31 AND di = 5 AND BBOX(g, -38.857822, -76.111145,
>>> -74.64091, -38.61907) AND al <= 39.407307 AND s <= 1.6442835 AND b <=
>>> 83.14717 AND an <= 87.0774 AND he <= 40.89476 AND ve <= 88.761566 AND t <=
>>> 44.786507 AND m = true AND i = true.
>>> at org.geotools.filter.text.cql2.CQLCompiler.compileFilter(CQLC
>>> ompiler.java:106)
>>> at org.geotools.filter.text.commons.CompilerUtil.parseFilter(Co
>>> mpilerUtil.java:196)
>>> at org.geotools.filter.text.cql2.CQL.toFilter(CQL.java:134)
>>> at org.geotools.filter.text.cql2.CQL.toFilter(CQL.java:113)
>>> at com.hps.GeomesaClient.query(GeomesaClient.java:134)
>>> at com.hps.Reader.run(Reader.java:69)
>>> at java.lang.Thread.run(Thread.java:745)
>>>
>>> This seems to be a bug in the ECQL parser. I posted the same on
>>> stackoverflow
>>> <http://stackoverflow.com/questions/43820026/geotools-filter-cqlexception-encountered-t/43825958#43825958>
>>> and
>>> found an answer saying, that it is a limitation in the ECQL query parser.
>>> The letter 't' by itself (ignoring case) is the UTC token.
>>>
>>> https://github.com/geotools/geotools/blob/master/modules/lib
>>> rary/cql/src/main/jjtree/ECQLGrammar.jjt#L180-L187
>>>
>>> Thank You
>>> Suresh Prajapati
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> GeoTools-GT2-Users mailing list
>>> GeoTools-GT2-Users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>>
>>
>>
>> --
>> Ian Turton
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> GeoTools-GT2-Users mailing list
>> GeoTools-GT2-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
>
> _______________________________________________
> GeoTools-GT2-Users mailing
> listGeoTools-GT2-Users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users