[Geoserver-devel] [JIRA] (GEOS-9086) Issue Casting TimeStamp Column to String/Text For CQL Filtering

Zack Brown created an issue

GeoServer / BugGEOS-9086

Issue Casting TimeStamp Column to String/Text For CQL Filtering

Issue Type:

BugBug

Affects Versions:

2.13.3

Assignee:

Unassigned

Created:

05/Jan/19 12:56 AM

Environment:

Google Chrome

Priority:

MediumMedium

Reporter:

Zack Brown

For the purposes of my project, I am allowing users to search a value against multiple columns (from a layer within GeoServer). I have decided to filter using the ILIKE operator for this comparison, so I need to be able to convert/cast the columns to String types. (I do not want to use data-specific operators in this case as I allow it elsewhere).

I couldn’t find a casting function within the Filter Function References GeoServer documentation, so I used strConcate(Column, ‘%’) as a workaround. I believe this works, since it returns a string and it combines the wildcard character ‘%’ to the column which should return this value as a string.
The results from filtering on columns using this CQL filter worked in most cases, however, when I have a timestamp column type, I get inconsistent results when I try to filter on it using this method.

Example:
The timestamp column has data “2015-05-21 10:53:00”.
If I search for “2015-05-21” the records with “2015-05-21 10:53:00” are returned successfully.
However, if I search for “2015-05-21 10:53” or just search using the time “10:53” I do not get any results. (The GeoServer logs show no errors and it seems to have run correctly, but it doesn’t return the records)

Is there any other efficient way to cast column to String types in order to use the ILIKE operator on them or, if my solution works, is there a reason why my results are not being returned correctly? I believe the timestamp data is being casted to a string, because “2015-05-21” will return the values I am expected, however, I believe there might be another issue I am not aware of.

Thank you for your time.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100096-sha1:6ea4425)

Atlassian logo