[JBoss JIRA] (TEIID-5474) NPE on Complex Query with Procedure Call in SELECT
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5474?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5474:
---------------------------------------
Thanks for capturing this. It is caused by a bad interaction between the common table planning logic and a correlated subquery in the select clause - the correlated references are not being set until after the common table planning, which causes the initial run of output element assignment to be incorrect. The fix should be straight-forward.
> NPE on Complex Query with Procedure Call in SELECT
> --------------------------------------------------
>
> Key: TEIID-5474
> URL: https://issues.jboss.org/browse/TEIID-5474
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 11.1
> Environment: teiid-11.1.0 (from 01.09.2018) on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 11.2
>
>
> Running the following query:
> {code:sql}
> SELECT
> (exec "SYSADMIN.logMsg"(
> "level" => 'INFO',
> "context" => 'DEBUG.FOO.BAR',
> "msg" => tccd.bank_account_holder_name)) as something
> FROM
> (
> SELECT c.city AS "bank_account_holder_name"
> FROM "adventureworks.address" c
> JOIN
> (
> select ca.addressid
> from "adventureworks.customeraddress" ca
> cross JOIN
> (
> WITH latest_exchange_rates AS
> (
> SELECT exchange_rate_date AS month_begin
> FROM (
> SELECT CURDATE() as exchange_rate_date
> )t
> )
> SELECT DISTINCT dt.month_start AS month_begin
> FROM (
> CALL views.createDateDimensionsTable(
> "startdate" => TIMESTAMPADD(SQL_TSI_MONTH, 1, (SELECT month_begin FROM latest_exchange_rates)),
> "enddate" => TIMESTAMPADD(SQL_TSI_YEAR, 15, (SELECT month_begin FROM latest_exchange_rates))
> ) ) AS dt
> ) fx
> ) ci ON ci.addressid = c.addressid
> ) tccd ;;
> {code}
> will throw out the following stacktrace with NPE:
> {code:noformat}
> 2018-09-13 13:35:21,777 ERROR [org.teiid.PROCESSOR] (Worker5_QueryProcessorQueue36) ZvEDctN1yjKY TEIID30019 Unexpected exception for request ZvEDctN1yjKY.15: java.lang.NullPointerExc
> eption
> at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.doMerge(RuleMergeVirtual.java:218)
> at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.execute(RuleMergeVirtual.java:80)
> at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:1025)
> at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:228)
> at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:179)
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:458)
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:672)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:351)
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:285)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
> 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)
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 6 months
[JBoss JIRA] (TEIID-5468) Potentially unexpected results due to null ordering with window functions
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5468?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5468.
-----------------------------------
Fix Version/s: 11.2
11.1.1
11.0.3
Resolution: Done
Extended the null order handling to order bys that exist in ordered limit views, aggregates, and window functions.
> Potentially unexpected results due to null ordering with window functions
> -------------------------------------------------------------------------
>
> Key: TEIID-5468
> URL: https://issues.jboss.org/browse/TEIID-5468
> Project: Teiid
> Issue Type: Quality Risk
> Components: Documentation, Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 11.2, 11.1.1, 11.0.3
>
>
> Similar to documentation notes that we make about the final user ordering, we should document that without an explicit ordering or the flag to push the teiid default ordering that window functions results may be different on a source with a different default null order.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 6 months
[JBoss JIRA] (TEIID-5474) NPE on Complex Query with Procedure Call in SELECT
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5474?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5474:
----------------------------------
Fix Version/s: 11.2
Priority: Critical (was: Blocker)
> NPE on Complex Query with Procedure Call in SELECT
> --------------------------------------------------
>
> Key: TEIID-5474
> URL: https://issues.jboss.org/browse/TEIID-5474
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 11.1
> Environment: teiid-11.1.0 (from 01.09.2018) on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 11.2
>
>
> Running the following query:
> {code:sql}
> SELECT
> (exec "SYSADMIN.logMsg"(
> "level" => 'INFO',
> "context" => 'DEBUG.FOO.BAR',
> "msg" => tccd.bank_account_holder_name)) as something
> FROM
> (
> SELECT c.city AS "bank_account_holder_name"
> FROM "adventureworks.address" c
> JOIN
> (
> select ca.addressid
> from "adventureworks.customeraddress" ca
> cross JOIN
> (
> WITH latest_exchange_rates AS
> (
> SELECT exchange_rate_date AS month_begin
> FROM (
> SELECT CURDATE() as exchange_rate_date
> )t
> )
> SELECT DISTINCT dt.month_start AS month_begin
> FROM (
> CALL views.createDateDimensionsTable(
> "startdate" => TIMESTAMPADD(SQL_TSI_MONTH, 1, (SELECT month_begin FROM latest_exchange_rates)),
> "enddate" => TIMESTAMPADD(SQL_TSI_YEAR, 15, (SELECT month_begin FROM latest_exchange_rates))
> ) ) AS dt
> ) fx
> ) ci ON ci.addressid = c.addressid
> ) tccd ;;
> {code}
> will throw out the following stacktrace with NPE:
> {code:noformat}
> 2018-09-13 13:35:21,777 ERROR [org.teiid.PROCESSOR] (Worker5_QueryProcessorQueue36) ZvEDctN1yjKY TEIID30019 Unexpected exception for request ZvEDctN1yjKY.15: java.lang.NullPointerExc
> eption
> at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.doMerge(RuleMergeVirtual.java:218)
> at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.execute(RuleMergeVirtual.java:80)
> at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:1025)
> at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:228)
> at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:179)
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:458)
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:672)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:351)
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:285)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
> 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)
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 6 months
[JBoss JIRA] (TEIID-5474) NPE on Complex Query with Procedure Call in SELECT
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5474?page=com.atlassian.jira.plugin... ]
Work on TEIID-5474 started by Steven Hawkins.
---------------------------------------------
> NPE on Complex Query with Procedure Call in SELECT
> --------------------------------------------------
>
> Key: TEIID-5474
> URL: https://issues.jboss.org/browse/TEIID-5474
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 11.1
> Environment: teiid-11.1.0 (from 01.09.2018) on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 11.2
>
>
> Running the following query:
> {code:sql}
> SELECT
> (exec "SYSADMIN.logMsg"(
> "level" => 'INFO',
> "context" => 'DEBUG.FOO.BAR',
> "msg" => tccd.bank_account_holder_name)) as something
> FROM
> (
> SELECT c.city AS "bank_account_holder_name"
> FROM "adventureworks.address" c
> JOIN
> (
> select ca.addressid
> from "adventureworks.customeraddress" ca
> cross JOIN
> (
> WITH latest_exchange_rates AS
> (
> SELECT exchange_rate_date AS month_begin
> FROM (
> SELECT CURDATE() as exchange_rate_date
> )t
> )
> SELECT DISTINCT dt.month_start AS month_begin
> FROM (
> CALL views.createDateDimensionsTable(
> "startdate" => TIMESTAMPADD(SQL_TSI_MONTH, 1, (SELECT month_begin FROM latest_exchange_rates)),
> "enddate" => TIMESTAMPADD(SQL_TSI_YEAR, 15, (SELECT month_begin FROM latest_exchange_rates))
> ) ) AS dt
> ) fx
> ) ci ON ci.addressid = c.addressid
> ) tccd ;;
> {code}
> will throw out the following stacktrace with NPE:
> {code:noformat}
> 2018-09-13 13:35:21,777 ERROR [org.teiid.PROCESSOR] (Worker5_QueryProcessorQueue36) ZvEDctN1yjKY TEIID30019 Unexpected exception for request ZvEDctN1yjKY.15: java.lang.NullPointerExc
> eption
> at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.doMerge(RuleMergeVirtual.java:218)
> at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.execute(RuleMergeVirtual.java:80)
> at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:1025)
> at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:228)
> at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:179)
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:458)
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:672)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:351)
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:285)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
> 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)
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 6 months
[JBoss JIRA] (TEIID-5474) NPE on Complex Query with Procedure Call in SELECT
by dalex dalex (JIRA)
dalex dalex created TEIID-5474:
----------------------------------
Summary: NPE on Complex Query with Procedure Call in SELECT
Key: TEIID-5474
URL: https://issues.jboss.org/browse/TEIID-5474
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 11.1
Environment: teiid-11.1.0 (from 01.09.2018) on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
Reporter: dalex dalex
Assignee: Steven Hawkins
Priority: Blocker
Running the following query:
{code:sql}
SELECT
(exec "SYSADMIN.logMsg"(
"level" => 'INFO',
"context" => 'DEBUG.FOO.BAR',
"msg" => tccd.bank_account_holder_name)) as something
FROM
(
SELECT c.city AS "bank_account_holder_name"
FROM "adventureworks.address" c
JOIN
(
select ca.addressid
from "adventureworks.customeraddress" ca
cross JOIN
(
WITH latest_exchange_rates AS
(
SELECT exchange_rate_date AS month_begin
FROM (
SELECT CURDATE() as exchange_rate_date
)t
)
SELECT DISTINCT dt.month_start AS month_begin
FROM (
CALL views.createDateDimensionsTable(
"startdate" => TIMESTAMPADD(SQL_TSI_MONTH, 1, (SELECT month_begin FROM latest_exchange_rates)),
"enddate" => TIMESTAMPADD(SQL_TSI_YEAR, 15, (SELECT month_begin FROM latest_exchange_rates))
) ) AS dt
) fx
) ci ON ci.addressid = c.addressid
) tccd ;;
{code}
will throw out the following stacktrace with NPE:
{code:noformat}
2018-09-13 13:35:21,777 ERROR [org.teiid.PROCESSOR] (Worker5_QueryProcessorQueue36) ZvEDctN1yjKY TEIID30019 Unexpected exception for request ZvEDctN1yjKY.15: java.lang.NullPointerExc
eption
at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.doMerge(RuleMergeVirtual.java:218)
at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.execute(RuleMergeVirtual.java:80)
at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:1025)
at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:228)
at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:179)
at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:458)
at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:672)
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:351)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:285)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
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)
{code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 6 months
[JBoss JIRA] (TEIID-5474) NPE on Complex Query with Procedure Call in SELECT
by dalex dalex (JIRA)
[ https://issues.jboss.org/browse/TEIID-5474?page=com.atlassian.jira.plugin... ]
dalex dalex updated TEIID-5474:
-------------------------------
Steps to Reproduce:
1. Add MySQL (in my case I use adventureworks test database) database configurations in standalone-teiid.xml:
{code:xml}
<datasource jndi-name="java:/adventureworks" pool-name="adventureworks" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/adventureworks?zeroDateTimeBehavior=convertToNull</connection-url>
<driver>mysql</driver>
<new-connection-sql>set SESSION sql_mode = 'ANSI'</new-connection-sql>
<pool>
<min-pool-size>2</min-pool-size>
<max-pool-size>70</max-pool-size>
</pool>
<security>
<user-name>root</user-name>
<password>xxxxxx</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
<timeout>
<blocking-timeout-millis>120000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
</datasource>
{code}
2. Add in test-vdb.xml java:/adventureworks configured in previous step as a data source:
{code:xml}
<model name="adventureworks">
<property name="importer.useFullSchemaName" value="false"/>
<property name="importer.tableTypes" value="TABLE,VIEW"/>
<property name="importer.importKeys" value="false"/>
<source name="adventureworks" translator-name="mylobs" connection-jndi-name="java:/adventureworks"/>
</model>
<translator name="mylobs" type="mysql5">
<property name="CopyLobs" value="true" />
<property name="SupportsNativeQueries" value="true"/>
</translator>
{code}
3. Add in test-vdb.xml "createDateDimensionsTable" virtual procedure:
{code:xml}
<model visible = "true" type = "VIRTUAL" name = "views">
<metadata type = "DDL"><![CDATA[
CREATE PROCEDURE createDateDimensionsTable(
IN startdate date NOT NULL OPTIONS (ANNOTATION 'Start date for table.'),
IN enddate date OPTIONS (ANNOTATION 'End date for table. If NULL, uses current date.')
)
RETURNS
(
"month_start" date
) AS
BEGIN
select CURDATE() as month_start;
END
]]>
</metadata>
</model>
{code}
4. Run the test query:
{code:sql}
SELECT
(exec "SYSADMIN.logMsg"(
"level" => 'INFO',
"context" => 'DEBUG.FOO.BAR',
"msg" => tccd.bank_account_holder_name)) as something
FROM
(
SELECT c.city AS "bank_account_holder_name"
FROM "adventureworks.address" c
JOIN
(
select ca.addressid
from "adventureworks.customeraddress" ca
cross JOIN
(
WITH latest_exchange_rates AS
(
SELECT exchange_rate_date AS month_begin
FROM (
SELECT CURDATE() as exchange_rate_date
)t
)
SELECT DISTINCT dt.month_start AS month_begin
FROM (
CALL views.createDateDimensionsTable(
"startdate" => TIMESTAMPADD(SQL_TSI_MONTH, 1, (SELECT month_begin FROM latest_exchange_rates)),
"enddate" => TIMESTAMPADD(SQL_TSI_YEAR, 15, (SELECT month_begin FROM latest_exchange_rates))
) ) AS dt
) fx
) ci ON ci.addressid = c.addressid
) tccd ;;
{code}
was:
1. Add MySQL (in my case I use adventureworks test database) database configurations in standalone-teiid.xml:
{code:xml}
<datasource jndi-name="java:/adventureworks" pool-name="adventureworks" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/adventureworks?zeroDateTimeBehavior=convertToNull</connection-url>
<driver>mysql</driver>
<new-connection-sql>set SESSION sql_mode = 'ANSI'</new-connection-sql>
<pool>
<min-pool-size>2</min-pool-size>
<max-pool-size>70</max-pool-size>
</pool>
<security>
<user-name>root</user-name>
<password>xxxxxx</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
<timeout>
<blocking-timeout-millis>120000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
</datasource>
{code}
2. Add in test-vdb.xml java:/adventureworks configured in previous step as data source:
{code:xml}
<model name="adventureworks">
<property name="importer.useFullSchemaName" value="false"/>
<property name="importer.tableTypes" value="TABLE,VIEW"/>
<property name="importer.importKeys" value="false"/>
<source name="adventureworks" translator-name="mylobs" connection-jndi-name="java:/adventureworks"/>
</model>
<translator name="mylobs" type="mysql5">
<property name="CopyLobs" value="true" />
<property name="SupportsNativeQueries" value="true"/>
</translator>
{code}
3. Add "createDateDimensionsTable" virtual procedure:
{code:xml}
<model visible = "true" type = "VIRTUAL" name = "views">
<metadata type = "DDL"><![CDATA[
CREATE PROCEDURE createDateDimensionsTable(
IN startdate date NOT NULL OPTIONS (ANNOTATION 'Start date for table.'),
IN enddate date OPTIONS (ANNOTATION 'End date for table. If NULL, uses current date.')
)
RETURNS
(
"month_start" date
) AS
BEGIN
select CURDATE() as month_start;
END
]]>
</metadata>
</model>
{code}
4. Run the test query:
{code:sql}
SELECT
(exec "SYSADMIN.logMsg"(
"level" => 'INFO',
"context" => 'DEBUG.FOO.BAR',
"msg" => tccd.bank_account_holder_name)) as something
FROM
(
SELECT c.city AS "bank_account_holder_name"
FROM "adventureworks.address" c
JOIN
(
select ca.addressid
from "adventureworks.customeraddress" ca
cross JOIN
(
WITH latest_exchange_rates AS
(
SELECT exchange_rate_date AS month_begin
FROM (
SELECT CURDATE() as exchange_rate_date
)t
)
SELECT DISTINCT dt.month_start AS month_begin
FROM (
CALL views.createDateDimensionsTable(
"startdate" => TIMESTAMPADD(SQL_TSI_MONTH, 1, (SELECT month_begin FROM latest_exchange_rates)),
"enddate" => TIMESTAMPADD(SQL_TSI_YEAR, 15, (SELECT month_begin FROM latest_exchange_rates))
) ) AS dt
) fx
) ci ON ci.addressid = c.addressid
) tccd ;;
{code}
> NPE on Complex Query with Procedure Call in SELECT
> --------------------------------------------------
>
> Key: TEIID-5474
> URL: https://issues.jboss.org/browse/TEIID-5474
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 11.1
> Environment: teiid-11.1.0 (from 01.09.2018) on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Priority: Blocker
>
> Running the following query:
> {code:sql}
> SELECT
> (exec "SYSADMIN.logMsg"(
> "level" => 'INFO',
> "context" => 'DEBUG.FOO.BAR',
> "msg" => tccd.bank_account_holder_name)) as something
> FROM
> (
> SELECT c.city AS "bank_account_holder_name"
> FROM "adventureworks.address" c
> JOIN
> (
> select ca.addressid
> from "adventureworks.customeraddress" ca
> cross JOIN
> (
> WITH latest_exchange_rates AS
> (
> SELECT exchange_rate_date AS month_begin
> FROM (
> SELECT CURDATE() as exchange_rate_date
> )t
> )
> SELECT DISTINCT dt.month_start AS month_begin
> FROM (
> CALL views.createDateDimensionsTable(
> "startdate" => TIMESTAMPADD(SQL_TSI_MONTH, 1, (SELECT month_begin FROM latest_exchange_rates)),
> "enddate" => TIMESTAMPADD(SQL_TSI_YEAR, 15, (SELECT month_begin FROM latest_exchange_rates))
> ) ) AS dt
> ) fx
> ) ci ON ci.addressid = c.addressid
> ) tccd ;;
> {code}
> will throw out the following stacktrace with NPE:
> {code:noformat}
> 2018-09-13 13:35:21,777 ERROR [org.teiid.PROCESSOR] (Worker5_QueryProcessorQueue36) ZvEDctN1yjKY TEIID30019 Unexpected exception for request ZvEDctN1yjKY.15: java.lang.NullPointerExc
> eption
> at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.doMerge(RuleMergeVirtual.java:218)
> at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.execute(RuleMergeVirtual.java:80)
> at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:1025)
> at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:228)
> at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:179)
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:458)
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:672)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:351)
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:285)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
> 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)
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 6 months
[JBoss JIRA] (TEIID-5473) Make JDBCMetadataProcessor more extensible with protected methods
by Ken Geis (JIRA)
Ken Geis created TEIID-5473:
-------------------------------
Summary: Make JDBCMetadataProcessor more extensible with protected methods
Key: TEIID-5473
URL: https://issues.jboss.org/browse/TEIID-5473
Project: Teiid
Issue Type: Feature Request
Components: JDBC Connector
Affects Versions: 11.1
Reporter: Ken Geis
Assignee: Steven Hawkins
I believe I can write a JDBCMetadataProcessor that works faster against my Oracle database. The important part to override is in getIndexes(..). This method is package-private, so I cannot override it. It would be useful to me if the method (and maybe others) were made protected so that they can be overridden.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 6 months
[JBoss JIRA] (TEIID-5472) Clean up window function project node implementation
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-5472:
-------------------------------------
Summary: Clean up window function project node implementation
Key: TEIID-5472
URL: https://issues.jboss.org/browse/TEIID-5472
Project: Teiid
Issue Type: Quality Risk
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 11.2
The initial implementation of window functions did not allow for a frame clause and specifically separated the logic of creating row and range values. Now that the logic is more complete we should remove some of the initial design aspects.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 6 months