[fdo-internals] RE: CurrentDate and ExtractToInt for King.Oracle

Romica Dascalescu Romica.Dascalescu at autodesk.com
Thu Nov 25 12:45:19 EST 2010


Hi Trevor,

I added a few comments [RD] below.

Thanks,
Romy.

-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org [mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Trevor Wekel
Sent: Thursday, November 25, 2010 12:16 PM
To: FDO Internals Mail List
Subject: [fdo-internals] RE: CurrentDate and ExtractToInt for King.Oracle

Thanks Romy,

I tried it both ways - with and without the quotes.  
[RD] It's normal to not work since King.Oracle do not support these functions. The capabilities also expose only a few functions as supported.

I suspect the key issue is that King.Oracle is not using the expression engine.
[RD] Yes, King.Oracle do not use expression engine, however it will not be wise to use it :), having such a powerful server like Oracle in back side, provider should be able to add these functions without using Expression Engine.

Just out of curiosity, which providers make use of the expression engine for filters?
[RD] SDF, SHP for sure

Maybe we can change code in MapGuide to use the expression engine for filters as well.
[RD] Hard to believe that mainly because this will sound like client side filtering which is what we try to avoid (performance reasons). Imagine a client filtering done in WFS (which is already slow).

The difference between tooltip and filter functionality is "weird" from a user perspective.
[RD] Just to expose a text in a tooltip is way less costly than filtering.

And date comparisons with King.Oracle are very problematic.  Since the King.Oracle provider does not provide string parsing functions, I think "date in a filter" is unusable.
[RD] Here is the point where the open source community becomes important :).

Regards,
Trevor.

-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org [mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Romica Dascalescu
Sent: November 25, 2010 8:38 AM
To: FDO Internals Mail List
Subject: [fdo-internals] RE: CurrentDate and ExtractToInt for King.Oracle

Hi Trevor,

I think this use case is in Map Guide where the content of tooltips is evaluated using the Expression Engine, having all functions available and that's why you see the value.

Now, each provider can use Expression Engine to support more functions or not (provide own implementation or not implement it at all).
Expression Engine is a module offering ways to evaluate filters and expressions (paying a price on performance) but this do not come for free, the provider owner/developer needs to add some code in order to use Expression Engine. So, Expression Engine is not enforced to all providers or in places where a function is not supported (e.g. SQLite provider do not use at all Expression Engine).

When provider evaluates filters the filter go against the provider directly and the provider needs to be aware of the functions passed in the filter in order to be able to evaluate them.
Looking at KingOracle provider expression capability I can see only a few functions are supported: CEIL, FLOOR, SUM, COUNT, MIN, AVG, MAX, LOWER, UPPER, CONCAT, SPATIALEXTENTS and that's why you filter did not work.
More than that your filter is invalid since function ExtractToInt() will return an integer which you compare it with a string :) So your filter should be: ExtractToInt('YEAR', CurrentDate()) = 2010

Regards,
Romy.

-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org [mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Trevor Wekel
Sent: Wednesday, November 24, 2010 4:34 PM
To: FDO Internals Mail List
Subject: [fdo-internals] CurrentDate and ExtractToInt for King.Oracle

Hello Fdo wizards,

I am seeing an interesting quirk with the King.Oracle provider.  If ExtractToInt('YEAR', CurrentDate()) is used in a tooltip, I get "2010" back.  If the same statement is used in a filter, ExtractToInt('YEAR', CurrentDate()) = '2010' then it does not work.  The GetCapabilities document for King.Oracle does not include the ExtractToInt() or CurrentDate() functions.  However, I thought these function were implemented by the expression engine and were common to all providers.

Can anyone provide some enlightenment on this behaviour?


Thank you,
Trevor

_______________________________________________
fdo-internals mailing list
fdo-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-internals



More information about the fdo-internals mailing list