Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1500814

Summary: Cannot run time-based queries against Osisoft PI
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Andrej Smigala <asmigala>
Component: Teiid, DocumentationAssignee: David Le Sage <dlesage>
Status: CLOSED WONTFIX QA Contact: Jan Stastny <jstastny>
Severity: high Docs Contact:
Priority: high    
Version: 6.4.0CC: asmigala, blafond, dlesage, drieden, gjospin, jolee, jschatte, thauser, vhalbert
Target Milestone: GAKeywords: Documentation
Target Release: 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
You cannot run time-based queries against Osisoft PI. This is because JDV pushes a cast to the string on the Time column, which results in a string comparison on the datasource.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-01 08:22:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrej Smigala 2017-10-11 14:24:07 UTC
Osisoft PI supports a relative time literals syntax, e.g.

> select * from dvqe.Data.Archive a where a.time between '*-14d' and '*'

will select all data between right now and 14 days ago, and

> select * from dvqe.Data.Archive a where a.time > 'y'

will select all data after yesterday midnight.
The string literals are converted to time values in the PI Server

Running the same queries through teiid however returns incorrect results, because teiid pushes a cast to string on the Time column, which results in string comparison on the datasource

Pushed query:

> SELECT TOP 100 cast(g_0.[ElementAttributeID] as String), g_0.[Time] AS c_1, g_0.[Value] AS c_2, g_0.[ValueInt] AS c_3, g_0.[ValueDbl] AS c_4, g_0.[ValueStr] AS c_5, cast(g_0.[ValueGuid] as String), g_0.[ValueDateTime] AS c_7, g_0.[Status] AS c_8, g_0.[Annotated] AS c_9, g_0.[IsGood] AS c_10, g_0.[Questionable] AS c_11, g_0.[Substituted] AS c_12 FROM [dvqe].[Data].[Archive] AS g_0 WHERE cast(g_0.[Time] AS String) > 'y'

Comment 4 David Le Sage 2017-11-27 22:58:33 UTC
Documented as known issue in release notes errata.

Comment 6 Red Hat Bugzilla 2023-09-14 04:09:46 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days