[JBoss JIRA] (TEIID-5803) Seems to be not possible to POST a new entity via a navigation property to a collection
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5803?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5803.
-----------------------------------
Resolution: Explained
Marking as resolved/explained.
> Seems to be not possible to POST a new entity via a navigation property to a collection
> ---------------------------------------------------------------------------------------
>
> Key: TEIID-5803
> URL: https://issues.jboss.org/browse/TEIID-5803
> Project: Teiid
> Issue Type: Bug
> Reporter: Christoph John
> Assignee: Steven Hawkins
> Priority: Major
>
> Hello Steven,
> I am currently trying to post/create an entity in a collection via a relative binding path. Unfortunately, I always get an error saying
> {"error":{"code":null,"message":"HTTP method 'POST' not allowed for this resource."}}
> I have bound the root view to .../Account(1) from which I have a navigation property to the relevant collection. Currently I have trouble to post to collections via a navigation path.
> As far as I understood from
> http://docs.oasis-open.org/odata/odata/v4.01/csprd04/part1-protocol/odata...
> chapter 11.4.2 this should work according to my tries below.
> Might you tell me if my path via the navigation property should work for post requests or what I am doing wrong?
> Directly writing to the collection is fine, i.e. something like the following:
> curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/UserDefinedProducts
> and a GET request via a navigation property path (given below) also works, but a path via a navigation property does not work when using the path in a POST request. I.e. when going via the navigation property. Example:
> curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/Account\(1\)/UserDefined...
> Here you find the backend metadata. They show that UserDefinedProducts_fKUserDefinedProductToAccount is simply a navigaton path from Account(xxx) to the UserDefinedProducts collection.
> https://ecubed-solutions.ddnss.de/odata4/svc/my_nutri_diary/$metadata
> user: sap
> password: sap
> Thanks a lot for your help!
> Note: I am currently trying to add data via a navigation property path because my frontend library sapui5 only caches and syncs data queried via a single context binding. Hence, to be consistent via all views in my app which bind to the odata model, I need to use only one absolute binding and have to query/update other contexts via relative binding paths from this single absolute path, to allow for all frontend views to maintain data consistency
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5736) General odata function mapping
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5736?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5736:
----------------------------------
Fix Version/s: 13.0
(was: 12.3)
> General odata function mapping
> ------------------------------
>
> Key: TEIID-5736
> URL: https://issues.jboss.org/browse/TEIID-5736
> Project: Teiid
> Issue Type: Quality Risk
> Components: OData
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 13.0
>
>
> We are currently mapping procedures and functions defined by ddl to odata functions/actions. The latter is due that the function is represented in our system metadata as a procedure. We need to decide if all functions should be mapped. There's also the notion of a composable function that could be helpful.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5806) Invalid select symbol name in source query
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5806?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5806.
-----------------------------------
Resolution: Done
Updated the expression mapping visitor to only use an expression symbol when the incoming symbol is not a properly named symbol. Also updated the alias generator to not use expression symbols directly - as their notion of equality is based upon the symbol and not the name.
> Invalid select symbol name in source query
> ------------------------------------------
>
> Key: TEIID-5806
> URL: https://issues.jboss.org/browse/TEIID-5806
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 12.3, 12.2.2
>
>
> A set operation involving a nested view can result in expression symbols in the select clause of the first union branch which cause the alias generator logic to not work properly (as the expressions can collide) and place an unwanted projected symbol in the select clause of the source query. This could look something like:
> select v_0.c_0 ... v_0.actualName ...
> This can be reproduced with:
> {code}
> create foreign table smalla (intkey integer, stringkey string);
> create foreign table smallb (intkey integer, stringkey string);
> create view inner_view as (select null as x, null as y from smalla);
> {code}
> and issuing the query:
> {code}
> select x, y FROM (select x, y, null as z from inner_view union select intkey, stringkey, null from smallb) v LIMIT 99999
> {code}
> Note that the inner_view has two projected expressions with the same constant/null value.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5806) Invalid select symbol name in source query
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5806?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5806:
----------------------------------
Workaround Description: The same query will succeed if the inner view is an inline view, rather than an actual view.
Workaround: Workaround Exists
> Invalid select symbol name in source query
> ------------------------------------------
>
> Key: TEIID-5806
> URL: https://issues.jboss.org/browse/TEIID-5806
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 12.3, 12.2.2
>
>
> A set operation involving a nested view can result in expression symbols in the select clause of the first union branch which cause the alias generator logic to not work properly (as the expressions can collide) and place an unwanted projected symbol in the select clause of the source query. This could look something like:
> select v_0.c_0 ... v_0.actualName ...
> This can be reproduced with:
> {code}
> create foreign table smalla (intkey integer, stringkey string);
> create foreign table smallb (intkey integer, stringkey string);
> create view inner_view as (select null as x, null as y from smalla);
> {code}
> and issuing the query:
> {code}
> select x, y FROM (select x, y, null as z from inner_view union select intkey, stringkey, null from smallb) v LIMIT 99999
> {code}
> Note that the inner_view has two projected expressions with the same constant/null value.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5806) Invalid select symbol name in source query
by Steven Hawkins (Jira)
Steven Hawkins created TEIID-5806:
-------------------------------------
Summary: Invalid select symbol name in source query
Key: TEIID-5806
URL: https://issues.jboss.org/browse/TEIID-5806
Project: Teiid
Issue Type: Bug
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 12.3, 12.2.2
A set operation involving a nested view can result in expression symbols in the select clause of the first union branch which cause the alias generator logic to not work properly (as the expressions can collide) and place an unwanted projected symbol in the select clause of the source query. This could look something like:
select v_0.c_0 ... v_0.actualName ...
This can be reproduced with:
{code}
create foreign table smalla (intkey integer, stringkey string);
create foreign table smallb (intkey integer, stringkey string);
create view inner_view as (select null as x, null as y from smalla);
{code}
and issuing the query:
{code}
select x, y FROM (select x, y, null as z from inner_view union select intkey, stringkey, null from smallb) v LIMIT 99999
{code}
Note that the inner_view has two projected expressions with the same constant/null value.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5804) is distinct from results in TEIID30167 could not find symbol
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5804?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5804.
-----------------------------------
Fix Version/s: 12.3
12.1.2
12.2.2
Resolution: Done
The issue is caused by a rewrite/mapping of is distinct - the expression mapping visitor was missing handling for is distinct. This resulted in the old symbol names being retained. This has now been corrected.
> is distinct from results in TEIID30167 could not find symbol
> ------------------------------------------------------------
>
> Key: TEIID-5804
> URL: https://issues.jboss.org/browse/TEIID-5804
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 12.2.1
> Reporter: Bram Gadeyne
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 12.3, 12.1.2, 12.2.2
>
> Attachments: not_working.sql, working.sql
>
>
> An error "Could not find symbol: n.hospadmissiontime" occurs when executing the statement below. I'll add a full sql script because this is executed in a procedure. Running this outside of a procedure does not seem to result in an issue.
> SELECT n.*
> FROM #tmp_admission_to_update tu
> join tmp_newvals n on n.admissionid = tu.patientid
> join tmp_oldvals o on o.admissionid = tu.patientid
> where tu.in_tbl and
> (
> n.hospadmissiontime is distinct from o.hospadmissiontime or
> n.origin is distinct from o.origin or
> n.hospital is distinct from o.hospital or
> n.gender is distinct from o.gender or
> n.nationality is distinct from o.nationality or
> n.postalcode is distinct from o.postalcode or
> n.country is distinct from o.country or
> n.hospitaldischargetime is distinct from o.hospitaldischargetime or
> n.destination is distinct from o.destination or
> n.warddischarge is distinct from o.warddischarge or
> (n.foto is null and o.foto is not null)
> )
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5804) is distinct from results in TEIID30167 could not find symbol
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5804?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5804:
----------------------------------
Component/s: Query Engine
> is distinct from results in TEIID30167 could not find symbol
> ------------------------------------------------------------
>
> Key: TEIID-5804
> URL: https://issues.jboss.org/browse/TEIID-5804
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 12.2.1
> Reporter: Bram Gadeyne
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 12.3, 12.1.2, 12.2.2
>
> Attachments: not_working.sql, working.sql
>
>
> An error "Could not find symbol: n.hospadmissiontime" occurs when executing the statement below. I'll add a full sql script because this is executed in a procedure. Running this outside of a procedure does not seem to result in an issue.
> SELECT n.*
> FROM #tmp_admission_to_update tu
> join tmp_newvals n on n.admissionid = tu.patientid
> join tmp_oldvals o on o.admissionid = tu.patientid
> where tu.in_tbl and
> (
> n.hospadmissiontime is distinct from o.hospadmissiontime or
> n.origin is distinct from o.origin or
> n.hospital is distinct from o.hospital or
> n.gender is distinct from o.gender or
> n.nationality is distinct from o.nationality or
> n.postalcode is distinct from o.postalcode or
> n.country is distinct from o.country or
> n.hospitaldischargetime is distinct from o.hospitaldischargetime or
> n.destination is distinct from o.destination or
> n.warddischarge is distinct from o.warddischarge or
> (n.foto is null and o.foto is not null)
> )
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months