[JBoss JIRA] (TEIID-5397) RETURN_GENERATED_KEYS not working
by Lukáš Svačina (JIRA)
[ https://issues.jboss.org/browse/TEIID-5397?page=com.atlassian.jira.plugin... ]
Lukáš Svačina commented on TEIID-5397:
--------------------------------------
What about some conversion function in teiid sql / admin api? I have e.g. postgresql, table with column's datetype "timezone" and i want to know what data type i have to use on teiid's side (CREATE VIEW (id integer, when ???))?
> RETURN_GENERATED_KEYS not working
> ---------------------------------
>
> Key: TEIID-5397
> URL: https://issues.jboss.org/browse/TEIID-5397
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 10.2.1
> Reporter: Lukáš Svačina
> Assignee: Steven Hawkins
>
> *+VDB:+*
> {code}
> <vdb name="_GENERATED_form_shoes" version="2">
> <model name="_INTERNAL_internalModel" type="PHYSICAL">
> <source name="internal_postgresql" translator-name="postgresql" connection-jndi-name="java:/internal"/>
> </model>
> <model name="GEN_view" type="VIRTUAL">
> <metadata type="DDL">
> <![CDATA[ CREATE VIEW "_view_workflow_data" OPTIONS (UPDATABLE 'true')
> AS SELECT "public"."form_shoes_2"."size" AS "size", "public"."form_shoes_2"."model" AS "model",
> "public"."form_shoes_2"."id" AS "id" FROM "public"."form_shoes_2" ]]>
> </metadata>
> </model>
> </vdb>
> {code}
> *+TABLE:+*
> name: form_shoes_2
> columns: id (SERIAL) | size (INTEGER *NULLABLE*) | model (VARCHAR *NULLABLE*)
> *+PROBLEM:+*
> Connected into VDB using JDBC like:
> {code:java}
> final PreparedStatement statement = c.prepareStatement(...INSERT..., Statement.RETURN_GENERATED_KEYS);
> statement.executeUpdate();
> final ResultSet generatedKeys = statement.getGeneratedKeys();
> {code}
> *generatedKeys is empty if:*
> # INSERT INTO "form_shoes_2" ( "model" ) VALUES ( 'adidas x1' ) ...... e.g. not all columns are enumerated ... if so, you can provide NULL values to optional columns and generated keys WORK!
> # INSERT INTO "_view_workflow_data" (id, name, size) VALUES (42, 'adidas x2', 12 ) ....... e.g. insering into view (1:1, no joins involved) even when all columns ARE enumerated ... probably no way how to get generated keys here?
> *+QUESTIONS:+*
> # How to get last_insert_id() when inserting into foreign table/views (with/without joins)?
> # How to get updated rows (UPDATE ... RETURNING *)? At least primary keys of affected rows?
> Thanks for fixing/adding this functionality.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (TEIID-5397) RETURN_GENERATED_KEYS not working
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5397?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-5397:
-------------------------------------
An alternative could be adding support like
{code}
ALTER TABLE employee ADD PRIMARY KEY (ssn)
{code}
But currently, this does not exist in Teiid.
> RETURN_GENERATED_KEYS not working
> ---------------------------------
>
> Key: TEIID-5397
> URL: https://issues.jboss.org/browse/TEIID-5397
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 10.2.1
> Reporter: Lukáš Svačina
> Assignee: Steven Hawkins
>
> *+VDB:+*
> {code}
> <vdb name="_GENERATED_form_shoes" version="2">
> <model name="_INTERNAL_internalModel" type="PHYSICAL">
> <source name="internal_postgresql" translator-name="postgresql" connection-jndi-name="java:/internal"/>
> </model>
> <model name="GEN_view" type="VIRTUAL">
> <metadata type="DDL">
> <![CDATA[ CREATE VIEW "_view_workflow_data" OPTIONS (UPDATABLE 'true')
> AS SELECT "public"."form_shoes_2"."size" AS "size", "public"."form_shoes_2"."model" AS "model",
> "public"."form_shoes_2"."id" AS "id" FROM "public"."form_shoes_2" ]]>
> </metadata>
> </model>
> </vdb>
> {code}
> *+TABLE:+*
> name: form_shoes_2
> columns: id (SERIAL) | size (INTEGER *NULLABLE*) | model (VARCHAR *NULLABLE*)
> *+PROBLEM:+*
> Connected into VDB using JDBC like:
> {code:java}
> final PreparedStatement statement = c.prepareStatement(...INSERT..., Statement.RETURN_GENERATED_KEYS);
> statement.executeUpdate();
> final ResultSet generatedKeys = statement.getGeneratedKeys();
> {code}
> *generatedKeys is empty if:*
> # INSERT INTO "form_shoes_2" ( "model" ) VALUES ( 'adidas x1' ) ...... e.g. not all columns are enumerated ... if so, you can provide NULL values to optional columns and generated keys WORK!
> # INSERT INTO "_view_workflow_data" (id, name, size) VALUES (42, 'adidas x2', 12 ) ....... e.g. insering into view (1:1, no joins involved) even when all columns ARE enumerated ... probably no way how to get generated keys here?
> *+QUESTIONS:+*
> # How to get last_insert_id() when inserting into foreign table/views (with/without joins)?
> # How to get updated rows (UPDATE ... RETURNING *)? At least primary keys of affected rows?
> Thanks for fixing/adding this functionality.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (TEIID-5411) Remove pluggable server discovery from the JDBC client
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-5411:
-------------------------------------
Summary: Remove pluggable server discovery from the JDBC client
Key: TEIID-5411
URL: https://issues.jboss.org/browse/TEIID-5411
Project: Teiid
Issue Type: Quality Risk
Components: JDBC Driver
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 11.1
Pluggable ClientDiscovery is a little used feature that should be removed from the client so that we can further simplify ha handling.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (TEIID-5397) RETURN_GENERATED_KEYS not working
by Lukáš Svačina (JIRA)
[ https://issues.jboss.org/browse/TEIID-5397?page=com.atlassian.jira.plugin... ]
Lukáš Svačina commented on TEIID-5397:
--------------------------------------
Thanks for your response.
With "PRIMARY KEY (id)" defined it works (AUTO_INCREMENT is not necessary).
However i'm working with dynamic data sources where i can leverage using syntax "CREATE VIEW xxx AS query" i.e. I don't have to know column names and their TEIID data types (very important for me because i don't have to do any explicit data type conversion to teiid types like implicit type conversion does).
Is there any other syntax allowing to specify PRIMARY KEY for view WITHOUT need for enumerating all columns and their data types (teiid non standard data types)?
> RETURN_GENERATED_KEYS not working
> ---------------------------------
>
> Key: TEIID-5397
> URL: https://issues.jboss.org/browse/TEIID-5397
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 10.2.1
> Reporter: Lukáš Svačina
> Assignee: Steven Hawkins
>
> *+VDB:+*
> {code}
> <vdb name="_GENERATED_form_shoes" version="2">
> <model name="_INTERNAL_internalModel" type="PHYSICAL">
> <source name="internal_postgresql" translator-name="postgresql" connection-jndi-name="java:/internal"/>
> </model>
> <model name="GEN_view" type="VIRTUAL">
> <metadata type="DDL">
> <![CDATA[ CREATE VIEW "_view_workflow_data" OPTIONS (UPDATABLE 'true')
> AS SELECT "public"."form_shoes_2"."size" AS "size", "public"."form_shoes_2"."model" AS "model",
> "public"."form_shoes_2"."id" AS "id" FROM "public"."form_shoes_2" ]]>
> </metadata>
> </model>
> </vdb>
> {code}
> *+TABLE:+*
> name: form_shoes_2
> columns: id (SERIAL) | size (INTEGER *NULLABLE*) | model (VARCHAR *NULLABLE*)
> *+PROBLEM:+*
> Connected into VDB using JDBC like:
> {code:java}
> final PreparedStatement statement = c.prepareStatement(...INSERT..., Statement.RETURN_GENERATED_KEYS);
> statement.executeUpdate();
> final ResultSet generatedKeys = statement.getGeneratedKeys();
> {code}
> *generatedKeys is empty if:*
> # INSERT INTO "form_shoes_2" ( "model" ) VALUES ( 'adidas x1' ) ...... e.g. not all columns are enumerated ... if so, you can provide NULL values to optional columns and generated keys WORK!
> # INSERT INTO "_view_workflow_data" (id, name, size) VALUES (42, 'adidas x2', 12 ) ....... e.g. insering into view (1:1, no joins involved) even when all columns ARE enumerated ... probably no way how to get generated keys here?
> *+QUESTIONS:+*
> # How to get last_insert_id() when inserting into foreign table/views (with/without joins)?
> # How to get updated rows (UPDATE ... RETURNING *)? At least primary keys of affected rows?
> Thanks for fixing/adding this functionality.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (TEIID-4251) Built in support for Postgres DB as materialization target
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4251?page=com.atlassian.jira.plugin... ]
Work on TEIID-4251 started by Steven Hawkins.
---------------------------------------------
> Built in support for Postgres DB as materialization target
> ----------------------------------------------------------
>
> Key: TEIID-4251
> URL: https://issues.jboss.org/browse/TEIID-4251
> Project: Teiid
> Issue Type: Sub-task
> Components: Server
> Reporter: Ramesh Reddy
> Assignee: Steven Hawkins
> Fix For: 11.1
>
>
> If Postgres database is available along with install or assumed that it is available, then some of the materialization task can be automated, like
> - Creation of a common STATUS table
> - Creation of the materilization targets (create views on dbms)
> - On load, on undeploy and load scripts for all the materialization views
> We need to device a way this to be pluggable, such that based on success of this, we can provide additional support for other sources.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (TEIID-5066) Move resource-adapters configuration style more adaptable to Spring/OpenShift based datasources
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5066?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5066:
----------------------------------
Fix Version/s: 11.x
> Move resource-adapters configuration style more adaptable to Spring/OpenShift based datasources
> -----------------------------------------------------------------------------------------------
>
> Key: TEIID-5066
> URL: https://issues.jboss.org/browse/TEIID-5066
> Project: Teiid
> Issue Type: Enhancement
> Components: Connector API
> Reporter: Ramesh Reddy
> Assignee: Ramesh Reddy
> Fix For: 11.x
>
>
> The current configuration in the resource-adapters, i.e. ManagedConnectionFactory and managed connection are so tightly integrated with JCA semantics that use of this connection code else where in environments like Spring Boot or Embedded or OpenShift makes it either cumbersome or impossible.
> All resource-adapter modules need to be refactored such that JCA semantics are add-ons rather than main part of it.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (TEIID-5409) left join is reversed
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5409?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5409.
-----------------------------------
Resolution: Done
The issue was with a utility method created from a minor refactoring. It added join node children in a non-obvious manner. This fix was applied to all source branches back to 9.3 in case anyone wants to build from source to address on an older branch.
> left join is reversed
> ---------------------
>
> Key: TEIID-5409
> URL: https://issues.jboss.org/browse/TEIID-5409
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 10.3.1, 10.3.2
> Reporter: Bram Gadeyne
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 11.1, 11.0.1, 10.3.3
>
> Attachments: plan_teiid_10.3.2.txt, plan_teiid_9.1.txt
>
>
> A query that is run on teiid 9.1 results in 56186 rows.
> The same query that is run on teiid 10.3.2 results in 5919 rows.
> It seems like the left join is reversed.
> I've attached both query plans.
> The queries are exactly the same. Note that on 9.1 we've prefixed table names with cos2_5_.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months