[teiid-issues] [JBoss JIRA] (TEIID-5063) Issues with bigdecimal values and odata
Steven Hawkins (JIRA)
issues at jboss.org
Wed Sep 13 15:53:00 EDT 2017
[ https://issues.jboss.org/browse/TEIID-5063?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steven Hawkins updated TEIID-5063:
----------------------------------
Description:
Usage of bigdecimal literals in odata4 translator literals or procedure parameters results in an exception about the facet not being satisfied.
We are also with TEIID-4269 we were allowing more than just trailing 0s to be trimmed from the numeric values. This results in situations where you could return an entity with a value, but could not look it up by that value (as it would no longer be equal). We should instead let the facet fail if we can't just trim zeros.
was:
When querying a view with bigdecimal column thourgh odata, the following error is shown:
{noformat}
16:29:33,079 ERROR [org.teiid.ODATA] (http-0.0.0.0:8080-1) TEIID16050 Unable to process odata request due to: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The value '5.12' does not match the facets' constraints. with cause The value '5.12' does not match the facets' constraints.: org.apache.olingo.server.api.ODataApplicationException: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The value '5.12' does not match the facets' constraints.
at org.teiid.olingo.service.TeiidServiceHandler.read(TeiidServiceHandler.java:173) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.apache.olingo.server.core.requests.DataRequest$EntityRequest.execute(DataRequest.java:332)
at org.apache.olingo.server.core.requests.DataRequest.execute(DataRequest.java:255)
at org.apache.olingo.server.core.ServiceDispatcher.internalExecute(ServiceDispatcher.java:160)
at org.apache.olingo.server.core.ServiceDispatcher.execute(ServiceDispatcher.java:98)
at org.apache.olingo.server.core.OData4HttpHandler.process(OData4HttpHandler.java:67)
at org.teiid.olingo.web.ODataServlet.service(ODataServlet.java:43) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.teiid.olingo.web.ODataFilter.internalDoFilter(ODataFilter.java:231) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.teiid.olingo.web.ODataFilter.doFilter(ODataFilter.java:100) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.teiid.olingo.web.CorsFilter.doFilter(CorsFilter.java:80) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:512) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:656) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.23.Final-redhat-1.jar:7.5.23.Final-redhat-1]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_131]
Caused by: java.sql.SQLException: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The value '5.12' does not match the facets' constraints.
at org.teiid.olingo.service.EntityCollectionResponse.createEntity(EntityCollectionResponse.java:229) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.teiid.olingo.service.EntityCollectionResponse.createEntity(EntityCollectionResponse.java:148) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.teiid.olingo.service.EntityCollectionResponse.addRow(EntityCollectionResponse.java:99) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.teiid.olingo.service.LocalClient.executeSQL(LocalClient.java:298) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.teiid.olingo.service.TeiidServiceHandler.executeQuery(TeiidServiceHandler.java:348) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
at org.teiid.olingo.service.TeiidServiceHandler.read(TeiidServiceHandler.java:171) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
... 28 more
Caused by: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The value '5.12' does not match the facets' constraints.
at org.apache.olingo.commons.core.edm.primitivetype.EdmDecimal.internalValueToString(EdmDecimal.java:185)
at org.apache.olingo.commons.core.edm.primitivetype.AbstractPrimitiveType.valueToString(AbstractPrimitiveType.java:86)
at org.apache.olingo.server.core.responses.EntityResponse.buildLocation(EntityResponse.java:219)
at org.teiid.olingo.service.EntityCollectionResponse.createEntity(EntityCollectionResponse.java:201) [teiid-olingo-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
... 33 more
{noformat}
Fix Version/s: 10.0
8.12.x-6.4
9.3.4
9.2.6
Steps to Reproduce: (was: # deploy the following VDB:
{code:xml}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="teiid-4446" version="1">
<model name="views" type="VIRTUAL">
<metadata type="DDL">
<![CDATA[
CREATE VIEW vv1 (id bigdecimal PRIMARY KEY) AS (SELECT 5.12 AS id);
CREATE VIEW vv2 (id bigdecimal(3,2) PRIMARY KEY) AS (SELECT 5.12 AS id);
CREATE VIEW vv3 (id bigdecimal(3) PRIMARY KEY) AS (SELECT 5.12 AS id);
]]>
</metadata>
</model>
</vdb>
{code}
# go to http://localhost:8080/odata4/teiid-4446.1/views/vv1)
Summary: Issues with bigdecimal values and odata (was: Error when querying bigdecimal value through odata)
> Issues with bigdecimal values and odata
> ---------------------------------------
>
> Key: TEIID-5063
> URL: https://issues.jboss.org/browse/TEIID-5063
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 10.0, 8.12.x-6.4, 9.2.6, 9.3.4
>
>
> Usage of bigdecimal literals in odata4 translator literals or procedure parameters results in an exception about the facet not being satisfied.
> We are also with TEIID-4269 we were allowing more than just trailing 0s to be trimmed from the numeric values. This results in situations where you could return an entity with a value, but could not look it up by that value (as it would no longer be equal). We should instead let the facet fail if we can't just trim zeros.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the teiid-issues
mailing list