I am sure it was just lack of scope; since the virtual tables can be any
SQL query - it was probably not obvious how to integrate a select hint?
If you have a join for example which select would you like to add the hint
to? Or would you like to create a subquery and do the select on the result?

It sounds like a good idea though if you are interested in adding the
functionality.
--
Jody Garnett


On Tue, Dec 13, 2022 at 12:36 PM Uhrig, Stefan via GeoTools-Devel <
geotools-devel@lists.sourceforge.net> wrote:

> Hi all,
>
>
>
> Recently, a group of GeoServer users on HANA requested the possibility to
> append hints to SQL queries. Luckily, there was already
> SQLDialect#handleSelectHints(). So, I could just override the method in
> HanaDialect and append the hints to the query, which I did in [GEOT-7230] (
> https://github.com/geotools/geotools/pull/4064).
>
>
>
> Now the group of users who requested the feature noticed that it works for
> common GeoServer layers, but not for GeoServer views, which are based on
> GeoTools’ VirtualTable. I investigated and found that JDBCDataStore
> deliberately blocks the addition of search hints (
> https://github.com/geotools/geotools/blob/29394a11ce3128a625f5251abeb9b0b09cc0105b/modules/library/jdbc/src/main/java/org/geotools/jdbc/JDBCDataStore.java#L3505
> ).
>
>
>
> I found that the SQLDialect#handleSelectHints() has been introduced with
> “[GEOT-4707] Add a flag to force spatial index usage in sql server” (
> https://github.com/geotools/geotools/pull/371/files). Adding search hints
> to VirtualTable queries was blocked from the start.
>
>
>
> Does someone know why search hints are not added to VirtualTable queries?
>
>
>
> In the HANA use case, I could not identify any reason yet why the addition
> of search hints should be blocked. I might oversee something though. If
> there is no urgent reason to block search hints in VirtualTable queries,
> what would be a good way to support search hints on VirtualTable queries in
> a SQLDialect? Would the introduction of an additional function like
> appendSearchHintsToVirtualTableQueries() be acceptable?
>
>
>
> Thank you and best regards,
>
> Stefan
>
>
>
>
> _______________________________________________
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to