[JBoss JIRA] (TEIID-5216) JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5216?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5216:
---------------------------------------
> Also, For other types like Boolean , String , Int etc. there is no substing being used for removing the suffix Edm.
The code path you have highlighted is contingent upon the preceding logic in https://github.com/teiid/teiid/blob/48d83d0beeb525433ba7129ffc84ef9ee9787...
If the value is already of the correct type, or null, parseLiteral will not be called. Since the NATIVE_TYPE defaults to Edm.String, parseLiteral will then be called if value object type does not match the expected type. From what I have seen this will all work correctly as long as the NATIVE_TYPE is specified correctly in the Teiid metadata. My only conclusion is that you have created the Teiid metadata manually rather than relying on the import performed by the translator, correct?
On both master and 9.2.1 when I use the translator to perform the import of the OData metadata the Employees table is defined appropriately as shown above:
BirthDate timestamp OPTIONS (NATIVE_TYPE 'Edm.DateTimeOffset'),
HireDate timestamp OPTIONS (NATIVE_TYPE 'Edm.DateTimeOffset'),
> JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
> --------------------------------------------------------------------
>
> Key: TEIID-5216
> URL: https://issues.jboss.org/browse/TEIID-5216
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 9.2.1
> Environment: All
> Reporter: Pushkar Kamra
> Assignee: Steven Hawkins
> Fix For: 10.1
>
> Attachments: screenshot-1.png
>
>
> During the time of requesting ODatatype - DateTimeOffset from the from the following service - http://services.odata.org/V4/Northwind/Northwind.svc/
> Query - Select * from Employees.
> Using the above query it is unable to return DateTimeOffset values for it and returns the
> following error -
> java.lang.IllegalArgumentException: No enum constant org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.TimeOffset
> at java.lang.Enum.valueOf(Enum.java:238)
> at org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.valueOf(EdmPrimitiveTypeKind.java:24)
> at org.teiid.olingo.common.ODataTypeManager.parseLiteral(ODataTypeManager.java:332)
> at org.teiid.olingo.common.ODataTypeManager.convertToTeiidRuntimeType(ODataTypeManager.java:184)
> at org.teiid.translator.odata4.BaseQueryExecution.buildRow(BaseQueryExecution.java:244)
> at org.teiid.translator.odata4.ODataQueryExecution.next(ODataQueryExecution.java:122)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:435)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:238)
> at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:220)
> at com.sun.proxy.$Proxy398.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> From the initial level analysis and observation is has been observed teiid class - ODataTypeManager in that parselitreals method where ODatatype.Substring(4) is done which is causing the issue which is changing DateTimeOffset to TimeOffset and when it tries to find the Enum constant from the EdmPrimitiveTypeKind list it is unable find the changed name and this seems to be causing the issue in accessing the DateTimeOffset type datas from the containing tables.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5216) JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
by Pushkar Kamra (JIRA)
[ https://issues.jboss.org/browse/TEIID-5216?page=com.atlassian.jira.plugin... ]
Pushkar Kamra commented on TEIID-5216:
--------------------------------------
Hello Steven,
For the Employee table -
<EntityType Name="Employee">
<Key>
<PropertyRef Name="EmployeeID"/>
</Key>
<Property xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" Name="EmployeeID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity"/>
<Property Name="LastName" Type="Edm.String" Nullable="false" MaxLength="20"/>
<Property Name="FirstName" Type="Edm.String" Nullable="false" MaxLength="10"/>
<Property Name="Title" Type="Edm.String" MaxLength="30"/>
<Property Name="TitleOfCourtesy" Type="Edm.String" MaxLength="25"/>
<Property Name="BirthDate" Type="Edm.DateTimeOffset"/>
<Property Name="HireDate" Type="Edm.DateTimeOffset"/>
<Property Name="Address" Type="Edm.String" MaxLength="60"/>
<Property Name="City" Type="Edm.String" MaxLength="15"/>
<Property Name="Region" Type="Edm.String" MaxLength="15"/>
<Property Name="PostalCode" Type="Edm.String" MaxLength="10"/>
<Property Name="Country" Type="Edm.String" MaxLength="15"/>
<Property Name="HomePhone" Type="Edm.String" MaxLength="24"/>
<Property Name="Extension" Type="Edm.String" MaxLength="4"/>
<Property Name="Photo" Type="Edm.Binary" MaxLength="max"/>
<Property Name="Notes" Type="Edm.String" MaxLength="max"/>
<Property Name="ReportsTo" Type="Edm.Int32"/>
<Property Name="PhotoPath" Type="Edm.String" MaxLength="255"/>
<NavigationProperty Name="Employees1" Type="Collection(NorthwindModel.Employee)" Partner="Employee1"/>
<NavigationProperty Name="Employee1" Type="NorthwindModel.Employee" Partner="Employees1">
<ReferentialConstraint Property="ReportsTo" ReferencedProperty="EmployeeID"/>
</NavigationProperty>
<NavigationProperty Name="Orders" Type="Collection(NorthwindModel.Order)" Partner="Employee"/>
<NavigationProperty Name="Territories" Type="Collection(NorthwindModel.Territory)" Partner="Employees"/>
</EntityType>
Also, For other types like Boolean , String , Int etc. there is no substing being used for removing the suffix Edm.
> JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
> --------------------------------------------------------------------
>
> Key: TEIID-5216
> URL: https://issues.jboss.org/browse/TEIID-5216
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 9.2.1
> Environment: All
> Reporter: Pushkar Kamra
> Assignee: Steven Hawkins
> Fix For: 10.1
>
> Attachments: screenshot-1.png
>
>
> During the time of requesting ODatatype - DateTimeOffset from the from the following service - http://services.odata.org/V4/Northwind/Northwind.svc/
> Query - Select * from Employees.
> Using the above query it is unable to return DateTimeOffset values for it and returns the
> following error -
> java.lang.IllegalArgumentException: No enum constant org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.TimeOffset
> at java.lang.Enum.valueOf(Enum.java:238)
> at org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.valueOf(EdmPrimitiveTypeKind.java:24)
> at org.teiid.olingo.common.ODataTypeManager.parseLiteral(ODataTypeManager.java:332)
> at org.teiid.olingo.common.ODataTypeManager.convertToTeiidRuntimeType(ODataTypeManager.java:184)
> at org.teiid.translator.odata4.BaseQueryExecution.buildRow(BaseQueryExecution.java:244)
> at org.teiid.translator.odata4.ODataQueryExecution.next(ODataQueryExecution.java:122)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:435)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:238)
> at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:220)
> at com.sun.proxy.$Proxy398.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> From the initial level analysis and observation is has been observed teiid class - ODataTypeManager in that parselitreals method where ODatatype.Substring(4) is done which is causing the issue which is changing DateTimeOffset to TimeOffset and when it tries to find the Enum constant from the EdmPrimitiveTypeKind list it is unable find the changed name and this seems to be causing the issue in accessing the DateTimeOffset type datas from the containing tables.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5216) JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5216?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5216:
---------------------------------------
[~pushkar_kamra] how is the metadata for this source being defined? After some minor changes to get past the foreign key issue, the automatic import gives me:
{code}
CREATE FOREIGN TABLE Employees (
EmployeeID integer NOT NULL OPTIONS (NATIVE_TYPE 'Edm.Int32'),
LastName string(20) NOT NULL,
FirstName string(10) NOT NULL,
Title string(30),
TitleOfCourtesy string(25),
BirthDate timestamp OPTIONS (NATIVE_TYPE 'Edm.DateTimeOffset'),
HireDate timestamp OPTIONS (NATIVE_TYPE 'Edm.DateTimeOffset'),
Address string(60),
City string(15),
Region string(15),
PostalCode string(10),
Country string(15),
HomePhone string(24),
Extension string(4),
Photo varbinary(2147483647) OPTIONS (NATIVE_TYPE 'Edm.Binary'),
Notes string(2147483647),
ReportsTo integer OPTIONS (NATIVE_TYPE 'Edm.Int32'),
PhotoPath string(255),
PRIMARY KEY(EmployeeID)
) OPTIONS (UPDATABLE TRUE, "teiid_odata:NameInSchema" 'NorthwindModel.Employee', "teiid_odata:Type" 'ENTITY_COLLECTION');
{code}
Thus the NATIVE_TYPEs have the expected "Edm." prefix.
> JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
> --------------------------------------------------------------------
>
> Key: TEIID-5216
> URL: https://issues.jboss.org/browse/TEIID-5216
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 9.2.1
> Environment: All
> Reporter: Pushkar Kamra
> Assignee: Steven Hawkins
> Fix For: 10.1
>
> Attachments: screenshot-1.png
>
>
> During the time of requesting ODatatype - DateTimeOffset from the from the following service - http://services.odata.org/V4/Northwind/Northwind.svc/
> Query - Select * from Employees.
> Using the above query it is unable to return DateTimeOffset values for it and returns the
> following error -
> java.lang.IllegalArgumentException: No enum constant org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.TimeOffset
> at java.lang.Enum.valueOf(Enum.java:238)
> at org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.valueOf(EdmPrimitiveTypeKind.java:24)
> at org.teiid.olingo.common.ODataTypeManager.parseLiteral(ODataTypeManager.java:332)
> at org.teiid.olingo.common.ODataTypeManager.convertToTeiidRuntimeType(ODataTypeManager.java:184)
> at org.teiid.translator.odata4.BaseQueryExecution.buildRow(BaseQueryExecution.java:244)
> at org.teiid.translator.odata4.ODataQueryExecution.next(ODataQueryExecution.java:122)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:435)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:238)
> at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:220)
> at com.sun.proxy.$Proxy398.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> From the initial level analysis and observation is has been observed teiid class - ODataTypeManager in that parselitreals method where ODatatype.Substring(4) is done which is causing the issue which is changing DateTimeOffset to TimeOffset and when it tries to find the Enum constant from the EdmPrimitiveTypeKind list it is unable find the changed name and this seems to be causing the issue in accessing the DateTimeOffset type datas from the containing tables.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5219) Doc Update - Security Protocols
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5219?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5219.
-----------------------------------
Resolution: Done
Updated to differentiate between transport level security for direct odbc/teiid access and indirect OData/REST.
> Doc Update - Security Protocols
> -------------------------------
>
> Key: TEIID-5219
> URL: https://issues.jboss.org/browse/TEIID-5219
> Project: Teiid
> Issue Type: Task
> Components: Documentation
> Affects Versions: 10.x
> Reporter: Van Halbert
> Assignee: Van Halbert
> Priority: Minor
>
> Update the security protocol section to include the "odata" protocol, see [Security Protocol Section|https://teiid.gitbooks.io/documents/content/security/Teiid_Server_Transport_Security.html] Also, add examples.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5201) Update teiid pg_type schema to match PostgreSQL pg_type in support of NPGsql provider
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5201?page=com.atlassian.jira.plugin... ]
Steven Hawkins edited comment on TEIID-5201 at 1/17/18 10:31 AM:
-----------------------------------------------------------------
> If you agree I think this issue can still be marked as resolved because these changes does allow for a session to be created and queries be executed against any vdb using the npgsql provider. A separate issue can be created for tracking the information_schema support so meta information can be queried.
That sounds great, can you create the new issue? I'll also update our documentation to reference compatibility with npgsql.
was (Author: shawkins):
> If you agree I think this issue can still be marked as resolved because these changes does allow for a session to be created and queries be executed against any vdb using the npgsql provider. A separate issue can be created for tracking the information_schema support so meta information can be queried.
That sounds great, can you create the new issue? I'll also update our documentation to reference compatibility with npsql.
> Update teiid pg_type schema to match PostgreSQL pg_type in support of NPGsql provider
> -------------------------------------------------------------------------------------
>
> Key: TEIID-5201
> URL: https://issues.jboss.org/browse/TEIID-5201
> Project: Teiid
> Issue Type: Bug
> Components: ODBC, Query Engine
> Reporter: Divyesh Vallabh
> Assignee: Steven Hawkins
> Attachments: babynametest.zip, information_schema.log
>
>
> When using NpgSQL provider to connect to Teiid the connection fails because the teiid.pg_type table does not contain the column "typreceive"
> Add missing columns from Postgres.pg_type (https://www.postgresql.org/docs/9.2/static/catalog-pg-type.html) to teiid
> Add missing columns from Postgres.pg_user (https://www.postgresql.org/docs/9.2/static/view-pg-user.html) to teiid
> Add missing columns from Postgres.pg_constraint (https://www.postgresql.org/docs/9.2/static/catalog-pg-constraint.html) to teiid
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months