[JBoss JIRA] (TEIID-4418) Pushdown of a correlated with clause contains wrong correlated reference
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-4418:
-------------------------------------
Summary: Pushdown of a correlated with clause contains wrong correlated reference
Key: TEIID-4418
URL: https://issues.jboss.org/browse/TEIID-4418
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.7
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 9.1
A query such as:
{code}
select e1, e2 from pm1.g2 where e1 = (with CTE1 as /*+ no_inline */ (SELECT pm1.g2.e1 from pm1.g1) select e1 from CTE1)
{code}
will pushdown as:
{code}
SELECT g_0.e1, g_0.e2 FROM g2 AS g_0 WHERE g_0.e1 = (WITH CTE1 (e1) AS (SELECT g2.e1 AS expr1 FROM g1 AS g_0) SELECT g_1.e1 FROM CTE1 AS g_1)
{code}
Note the incorrect g2.e1 reference.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (TEIID-4417) Issues with OData query generation logic
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4417?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-4417:
-------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1371523
Bugzilla Update: Perform
> Issues with OData query generation logic
> ----------------------------------------
>
> Key: TEIID-4417
> URL: https://issues.jboss.org/browse/TEIID-4417
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 9.1, 9.0.4
>
>
> When the ODataExpressionToSQLBuilder changes the ctxExpression, ctxQuery and other state it needs to revert back, but currently does not.
> For example reordering the predicate:
> /odata4/vdb/PM1/G1?$filter=e1 eq $root/G1(1)/e1
> to
> /odata4/vdb/PM1/G1?$filter=$root/G1(1)/e1 eq e1
> results in a source query:
> SELECT g0.e1, g0.e2, g0.e3 FROM PM1.G1 AS g0 WHERE (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) = (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) ORDER BY g0.e2
> That has both sides of the predicate as subqueries.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (TEIID-4417) Issues with OData query generation logic
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4417?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4417.
-----------------------------------
Fix Version/s: 9.0.4
Resolution: Done
Addressed:
the issue with expression ordering when using root
ANY switched the context to the wrong group
ANY/ALL was generalized to handle any predicate, including one with no lambda variable
Allowed ANY/ALL and root to be used together
> Issues with OData query generation logic
> ----------------------------------------
>
> Key: TEIID-4417
> URL: https://issues.jboss.org/browse/TEIID-4417
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 9.1, 9.0.4
>
>
> When the ODataExpressionToSQLBuilder changes the ctxExpression, ctxQuery and other state it needs to revert back, but currently does not.
> For example reordering the predicate:
> /odata4/vdb/PM1/G1?$filter=e1 eq $root/G1(1)/e1
> to
> /odata4/vdb/PM1/G1?$filter=$root/G1(1)/e1 eq e1
> results in a source query:
> SELECT g0.e1, g0.e2, g0.e3 FROM PM1.G1 AS g0 WHERE (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) = (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) ORDER BY g0.e2
> That has both sides of the predicate as subqueries.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (TEIID-4417) Issues with OData query generation logic
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4417?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-4417:
----------------------------------
Description:
When the ODataExpressionToSQLBuilder changes the ctxExpression, ctxQuery and other state it needs to revert back, but currently does not.
For example reordering the predicate:
/odata4/vdb/PM1/G1?$filter=e1 eq $root/G1(1)/e1
to
/odata4/vdb/PM1/G1?$filter=$root/G1(1)/e1 eq e1
results in a source query:
SELECT g0.e1, g0.e2, g0.e3 FROM PM1.G1 AS g0 WHERE (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) = (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) ORDER BY g0.e2
That has both sides of the predicate as subqueries.
was:
When the ODataExpressionToSQLBuilder changes the ctxExpression in most instances it needs to revert back to the ctxQuery, but currently does not.
For example reordering the predicate:
/odata4/vdb/PM1/G1?$filter=e1 eq $root/G1(1)/e1
to
/odata4/vdb/PM1/G1?$filter=$root/G1(1)/e1 eq e1
results in a source query:
SELECT g0.e1, g0.e2, g0.e3 FROM PM1.G1 AS g0 WHERE (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) = (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) ORDER BY g0.e2
That has both sides of the predicate as subqueries.
Summary: Issues with OData query generation logic (was: ctxExpression logic doesn't reset the context)
> Issues with OData query generation logic
> ----------------------------------------
>
> Key: TEIID-4417
> URL: https://issues.jboss.org/browse/TEIID-4417
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 9.1
>
>
> When the ODataExpressionToSQLBuilder changes the ctxExpression, ctxQuery and other state it needs to revert back, but currently does not.
> For example reordering the predicate:
> /odata4/vdb/PM1/G1?$filter=e1 eq $root/G1(1)/e1
> to
> /odata4/vdb/PM1/G1?$filter=$root/G1(1)/e1 eq e1
> results in a source query:
> SELECT g0.e1, g0.e2, g0.e3 FROM PM1.G1 AS g0 WHERE (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) = (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) ORDER BY g0.e2
> That has both sides of the predicate as subqueries.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (TEIID-2578) add/remove schema elements
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2578?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-2578:
-------------------------------------
ALTER Support
{code}
ALTER [VIRTUAL | FOREIGN] (VIEW | TABLE) <table-name> [ AS <stmt>] ( ADD | DROP | ALTER) COLUMN <column-name> OPTIONS(...)
{code}
Some examples:
Foreign Table:
{code}
- Changing the options on the foreign table (same is true for view, replace table with view)
ALTER TABLE G1 ALTER OPTIONS ( (ADD|SET|DROP) key [value])
- Add a column on foreign table
ALTER TABLE G1 ADD COLUMN <column-name> <type> [<constraints> <options>]
- drop column on foreign table
ALTER TABLE G1 DROP COLUMN <column-name>
-- alter column on foreign table
ALTER TABLE G1 ALTER COLUMN <column-name> OPTIONS (ADD|SET|DROP key [value])
{code}
View Table: When adding and dropping a column on view, the transformation MUST be changed to reflect the change and to be valid. I found no examples of this anywhere. I am thinking based on above
{code}
ALTER VIEW <view-name> AS <stmt> ( ADD | DROP | ALTER) COLUMN <column-name> ..
{code}
the AS <stmt> is required, but I can not seem to figure out how I can contain the <stmt> during the parsing. [~shawkins] any suggestions ?
> add/remove schema elements
> --------------------------
>
> Key: TEIID-2578
> URL: https://issues.jboss.org/browse/TEIID-2578
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Ramesh Reddy
> Assignee: Ramesh Reddy
> Fix For: 9.1
>
>
> Schemas are currently static after load. Modifications can only happen with restarts or new versions. We should allow add/drop at runtime.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (TEIID-2578) add/remove schema elements
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2578?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-2578:
--------------------------------
Comment: was deleted
(was: h2. 1. Unit test error
The unit test still have some error
{code}
Tests in error:
TestMetadataValidator.testCreateTrigger:142->buildModel:71 » Metadata TEIID312...
TestMetadataValidator.testCreateTriggerFails:153->buildModel:71 » Metadata TEI...
TestMetadataValidator.testExternalMaterializationValidate:327->buildModel:71 » Metadata
TestMetadataValidator.testExternalMaterializationValidateColumnTypes:365->buildModel:71 » Metadata
TestMetadataValidator.testExternalMaterializationValidateColumns:347->buildModel:71 » Metadata
TestMetadataValidator.testExternalMaterializationValidateLoadScripts:411->buildModel:71 » Metadata
TestMetadataValidator.testExternalMaterializationValidateMissingColumns:395->buildModel:71 » Metadata
TestMetadataValidator.testExternalMaterializationValidateMissingStatus:380->buildModel:71 » Metadata
TestMetadataValidator.testInternalMaterializationValidate:309->buildModel:71 » Metadata
TestMetadataValidator.testModelArtifactsSucess:108->buildModel:71 » Metadata T...
TestMetadataValidator.testProcMetadata:178->buildModel:71 » Metadata TEIID3123...
TestMetadataValidator.testProcMetadataValidationError:187->buildModel:71 » Metadata
TestMetadataValidator.testResolveMetadata:130->buildModel:71 » Metadata TEIID3...
TestMetadataValidator.testResolveMetadataError:206->buildModel:71 » Metadata T...
TestMetadataValidator.testResolveTempMetadata:197->buildModel:71 » Metadata TE...
TestMetadataValidator.testViewKeys:488->buildModel:71 » Metadata TEIID31236 No...
TestMetadataValidator.testViewModelArtifacts:100->buildModel:71 » Metadata TEI...
TestDDLParser.testAlterDatabase:949->helpParse:763 » Metadata TEIID31214 DataW...
TestDDLParser.testAlterProcedureOptions:886->helpParse:747 » Parse TEIID30386 ...
TestDDLParser.testAlterTableAddColumnOptions:844->helpParse:747 » Metadata TEI...
TestDDLParser.testAlterTableAddOptions:798->helpParse:747 » Metadata TEIID3035...
TestDDLParser.testAlterTableDropOptions:828->helpParse:747 » Metadata TEIID303...
TestDDLParser.testAlterTableModifyOptions:813->helpParse:747 » Metadata TEIID3...
TestDDLParser.testAlterTableRemoveColumnOptions:864->helpParse:747 » Parse TEI...
TestDDLParser.testAlterView:1114->helpParse:763 » Metadata TEIID30357 G1 does ...
Tests run: 6043, Failures: 0, Errors: 25, Skipped: 65
{code}
h2. 2. create database failed
{code}
/subsystem=teiid:db-store(ddl="create database foo")
{
"outcome" => "failed",
"result" => undefined,
"failure-description" => "WFLYCTL0158: Operation handler failed: org.jboss.msc.service.ServiceNotFoundException: Service service jboss.teiid.database-storage not found",
"rolled-back" => true
}
{code}
The stacktrace in server
{code}
11:07:59,592 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 19) WFLYCTL0013: Operation ("db-store") failed - address: ([("subsystem" => "teiid")]): org.jboss.msc.service.ServiceNotFoundException: Service service jboss.teiid.database-storage not found
at org.jboss.msc.service.ServiceContainerImpl.getRequiredService(ServiceContainerImpl.java:669)
at org.jboss.as.controller.OperationContextImpl$OperationContextServiceRegistry.getRequiredService(OperationContextImpl.java:2211)
at org.teiid.jboss.TeiidOperationHandler.getDatabaseStorage(TeiidOperationHandler.java:165)
at org.teiid.jboss.DDLExecutor.executeOperation(TeiidOperationHandler.java:1721)
at org.teiid.jboss.DDLExecutor.executeOperation(TeiidOperationHandler.java:1684)
at org.teiid.jboss.BaseOperationHandler$1.execute(BaseOperationHandler.java:79)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:890)
at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:659)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:370)
at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1344)
at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:392)
at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:217)
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:208)
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.access$300(ModelControllerClientOperationHandler.java:130)
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1$1.run(ModelControllerClientOperationHandler.java:152)
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1$1.run(ModelControllerClientOperationHandler.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:92)
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:148)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$ManagementRequestContextImpl$1.doExecute(AbstractMessageHandler.java:363)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:472)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
{code})
> add/remove schema elements
> --------------------------
>
> Key: TEIID-2578
> URL: https://issues.jboss.org/browse/TEIID-2578
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Ramesh Reddy
> Assignee: Ramesh Reddy
> Fix For: 9.1
>
>
> Schemas are currently static after load. Modifications can only happen with restarts or new versions. We should allow add/drop at runtime.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (TEIID-4417) ctxQuery logic doesn't reset the context
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-4417:
-------------------------------------
Summary: ctxQuery logic doesn't reset the context
Key: TEIID-4417
URL: https://issues.jboss.org/browse/TEIID-4417
Project: Teiid
Issue Type: Bug
Components: OData
Affects Versions: 8.12
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Priority: Critical
Fix For: 9.1
When the ODataExpressionToSQLBuilder changes the ctxExpression in most instances it needs to revert back to the ctxQuery, but currently does not.
For example reordering the predicate:
/odata4/vdb/PM1/G1?$filter=e1 eq $root/G1(1)/e1
to
/odata4/vdb/PM1/G1?$filter=$root/G1(1)/e1 eq e1
results in a source query:
SELECT g0.e1, g0.e2, g0.e3 FROM PM1.G1 AS g0 WHERE (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) = (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) ORDER BY g0.e2
That has both sides of the predicate as subqueries.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (TEIID-4417) ctxExpression logic doesn't reset the context
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4417?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-4417:
----------------------------------
Summary: ctxExpression logic doesn't reset the context (was: ctxQuery logic doesn't reset the context)
> ctxExpression logic doesn't reset the context
> ---------------------------------------------
>
> Key: TEIID-4417
> URL: https://issues.jboss.org/browse/TEIID-4417
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 9.1
>
>
> When the ODataExpressionToSQLBuilder changes the ctxExpression in most instances it needs to revert back to the ctxQuery, but currently does not.
> For example reordering the predicate:
> /odata4/vdb/PM1/G1?$filter=e1 eq $root/G1(1)/e1
> to
> /odata4/vdb/PM1/G1?$filter=$root/G1(1)/e1 eq e1
> results in a source query:
> SELECT g0.e1, g0.e2, g0.e3 FROM PM1.G1 AS g0 WHERE (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) = (SELECT g1.e1 FROM PM1.G1 AS g1 WHERE g1.e2 = 1) ORDER BY g0.e2
> That has both sides of the predicate as subqueries.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months