[JBoss JIRA] (TEIID-3847) HiveTranslator should not use a Calendar for the Hive getDate
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3847?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3847.
-----------------------------------
Fix Version/s: 8.13
8.12.3
Resolution: Done
Thanks Dave for reporting this. The translator has been updated to avoid all calendar based calls and I updated the docs to indicate that the databasetimezone translator property is not used.
> HiveTranslator should not use a Calendar for the Hive getDate
> -------------------------------------------------------------
>
> Key: TEIID-3847
> URL: https://issues.jboss.org/browse/TEIID-3847
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.9
> Environment: Windows 7 and 64 bit linux.
> Reporter: Dave Nicodemus
> Assignee: Steven Hawkins
> Fix For: 8.13, 8.12.3
>
>
> The Hive JDBC driver does not support the get Date/Timestamp methods with Calendar parameters. This is handled correctly for time stamp but not for date. Data should be handled as well.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years
[JBoss JIRA] (TEIID-3846) Wrong alias rewriting in subqueries
by Salvatore R (JIRA)
[ https://issues.jboss.org/browse/TEIID-3846?page=com.atlassian.jira.plugin... ]
Salvatore R commented on TEIID-3846:
------------------------------------
No problem. Thanks for fixing this issue so quickly.
> Wrong alias rewriting in subqueries
> -----------------------------------
>
> Key: TEIID-3846
> URL: https://issues.jboss.org/browse/TEIID-3846
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.7
> Reporter: Salvatore R
> Assignee: Steven Hawkins
> Fix For: 8.13, 8.12.3
>
>
> I defined two tables in PostgreSQL (but it's reproducible also in other databases like MySQL, for example) as follows:
> {code:sql}
> CREATE TABLE test_a
> (
> a integer,
> b integer
> );
> CREATE TABLE test_b
> (
> b integer,
> c integer
> );
> {code}
> Running this query:
> {code:sql}
> SELECT
> *
> FROM
> ( SELECT
> ( SELECT x.a FROM pg.test_a AS x WHERE x.b = g_0.c ) AS c_2
> FROM
> pg.test_b AS g_0
> ) AS v_0
> {code}
> I get the following exception:
> {code:sql}
> 13:11:30,073 WARN [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue50) 1iTDksSjXt1V Connector worker process failed for atomic-request=1iTDksSjXt1V.16.1.11: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT v_0.c_0 FROM (SELECT (SELECT g_1."a" FROM "public"."test_a" AS g_1 WHERE g_1."b" = g_1."c") AS c_0 FROM "public"."test_b" AS g_0) AS v_0]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:349)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_67]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_67]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_67]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy47.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: org.postgresql.util.PSQLException: ERROR: column g_1.c does not exist
> Position: 91
> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
> ... 18 more
> {code}
> It seems that the problem is related to the alias "g_0" used for the source table "pg.test_b". In fact, if a different alias is used, the query runs without errors:
> {code:sql}
> SELECT
> *
> FROM
> ( SELECT
> ( SELECT x.a FROM pg.test_a AS x WHERE x.b = y.c ) AS c_2
> FROM
> pg.test_b AS y
> ) AS v_0
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years
[JBoss JIRA] (TEIID-3847) HiveTranslator should not use a Calendar for the Hive getDate
by Dave Nicodemus (JIRA)
Dave Nicodemus created TEIID-3847:
-------------------------------------
Summary: HiveTranslator should not use a Calendar for the Hive getDate
Key: TEIID-3847
URL: https://issues.jboss.org/browse/TEIID-3847
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.2
Environment: Windows 7 and 64 bit linux.
Reporter: Dave Nicodemus
Assignee: Steven Hawkins
The Hive JDBC driver does not support the get Date/Timestamp methods with Calendar parameters. This is handled correctly for time stamp but not for date. Data should be handled as well.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years
[JBoss JIRA] (TEIID-3846) Wrong alias rewriting in subqueries
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3846?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3846.
-----------------------------------
Resolution: Done
Thanks Salvatore. Added a check for correlated reference groups prior to running the alias generator to prevent using a duplicate.
> Wrong alias rewriting in subqueries
> -----------------------------------
>
> Key: TEIID-3846
> URL: https://issues.jboss.org/browse/TEIID-3846
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.7
> Reporter: Salvatore R
> Assignee: Steven Hawkins
> Fix For: 8.13, 8.12.3
>
>
> I defined two tables in PostgreSQL (but it's reproducible also in other databases like MySQL, for example) as follows:
> {code:sql}
> CREATE TABLE test_a
> (
> a integer,
> b integer
> );
> CREATE TABLE test_b
> (
> b integer,
> c integer
> );
> {code}
> Running this query:
> {code:sql}
> SELECT
> *
> FROM
> ( SELECT
> ( SELECT x.a FROM pg.test_a AS x WHERE x.b = g_0.c ) AS c_2
> FROM
> pg.test_b AS g_0
> ) AS v_0
> {code}
> I get the following exception:
> {code:sql}
> 13:11:30,073 WARN [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue50) 1iTDksSjXt1V Connector worker process failed for atomic-request=1iTDksSjXt1V.16.1.11: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT v_0.c_0 FROM (SELECT (SELECT g_1."a" FROM "public"."test_a" AS g_1 WHERE g_1."b" = g_1."c") AS c_0 FROM "public"."test_b" AS g_0) AS v_0]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:349)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_67]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_67]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_67]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy47.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: org.postgresql.util.PSQLException: ERROR: column g_1.c does not exist
> Position: 91
> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
> ... 18 more
> {code}
> It seems that the problem is related to the alias "g_0" used for the source table "pg.test_b". In fact, if a different alias is used, the query runs without errors:
> {code:sql}
> SELECT
> *
> FROM
> ( SELECT
> ( SELECT x.a FROM pg.test_a AS x WHERE x.b = y.c ) AS c_2
> FROM
> pg.test_b AS y
> ) AS v_0
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years
[JBoss JIRA] (TEIID-3846) Wrong alias rewriting in subqueries
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3846?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-3846:
----------------------------------
Component/s: Query Engine
> Wrong alias rewriting in subqueries
> -----------------------------------
>
> Key: TEIID-3846
> URL: https://issues.jboss.org/browse/TEIID-3846
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.7
> Reporter: Salvatore R
> Assignee: Steven Hawkins
> Fix For: 8.13, 8.12.3
>
>
> I defined two tables in PostgreSQL (but it's reproducible also in other databases like MySQL, for example) as follows:
> {code:sql}
> CREATE TABLE test_a
> (
> a integer,
> b integer
> );
> CREATE TABLE test_b
> (
> b integer,
> c integer
> );
> {code}
> Running this query:
> {code:sql}
> SELECT
> *
> FROM
> ( SELECT
> ( SELECT x.a FROM pg.test_a AS x WHERE x.b = g_0.c ) AS c_2
> FROM
> pg.test_b AS g_0
> ) AS v_0
> {code}
> I get the following exception:
> {code:sql}
> 13:11:30,073 WARN [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue50) 1iTDksSjXt1V Connector worker process failed for atomic-request=1iTDksSjXt1V.16.1.11: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT v_0.c_0 FROM (SELECT (SELECT g_1."a" FROM "public"."test_a" AS g_1 WHERE g_1."b" = g_1."c") AS c_0 FROM "public"."test_b" AS g_0) AS v_0]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:349)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_67]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_67]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_67]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy47.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: org.postgresql.util.PSQLException: ERROR: column g_1.c does not exist
> Position: 91
> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
> ... 18 more
> {code}
> It seems that the problem is related to the alias "g_0" used for the source table "pg.test_b". In fact, if a different alias is used, the query runs without errors:
> {code:sql}
> SELECT
> *
> FROM
> ( SELECT
> ( SELECT x.a FROM pg.test_a AS x WHERE x.b = y.c ) AS c_2
> FROM
> pg.test_b AS y
> ) AS v_0
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years
[JBoss JIRA] (TEIID-3846) Wrong alias rewriting in subqueries
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3846?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-3846:
----------------------------------
Fix Version/s: 8.13
8.12.3
Affects Version/s: 8.7
Yes, having what we effectively use as a generated alias in the outer scope is not accounted for correctly with a subquery.
> Wrong alias rewriting in subqueries
> -----------------------------------
>
> Key: TEIID-3846
> URL: https://issues.jboss.org/browse/TEIID-3846
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 8.7
> Reporter: Salvatore R
> Assignee: Steven Hawkins
> Fix For: 8.13, 8.12.3
>
>
> I defined two tables in PostgreSQL (but it's reproducible also in other databases like MySQL, for example) as follows:
> {code:sql}
> CREATE TABLE test_a
> (
> a integer,
> b integer
> );
> CREATE TABLE test_b
> (
> b integer,
> c integer
> );
> {code}
> Running this query:
> {code:sql}
> SELECT
> *
> FROM
> ( SELECT
> ( SELECT x.a FROM pg.test_a AS x WHERE x.b = g_0.c ) AS c_2
> FROM
> pg.test_b AS g_0
> ) AS v_0
> {code}
> I get the following exception:
> {code:sql}
> 13:11:30,073 WARN [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue50) 1iTDksSjXt1V Connector worker process failed for atomic-request=1iTDksSjXt1V.16.1.11: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT v_0.c_0 FROM (SELECT (SELECT g_1."a" FROM "public"."test_a" AS g_1 WHERE g_1."b" = g_1."c") AS c_0 FROM "public"."test_b" AS g_0) AS v_0]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:349)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_67]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_67]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_67]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy47.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: org.postgresql.util.PSQLException: ERROR: column g_1.c does not exist
> Position: 91
> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
> ... 18 more
> {code}
> It seems that the problem is related to the alias "g_0" used for the source table "pg.test_b". In fact, if a different alias is used, the query runs without errors:
> {code:sql}
> SELECT
> *
> FROM
> ( SELECT
> ( SELECT x.a FROM pg.test_a AS x WHERE x.b = y.c ) AS c_2
> FROM
> pg.test_b AS y
> ) AS v_0
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years
[JBoss JIRA] (TEIID-3842) Teiid's query's explain not consistence with other Database
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3842?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3842:
---------------------------------------
It's not a prefix, it's a statement that is run after show plan is set - See https://docs.jboss.org/author/display/TEIID/SET+Statement
> Teiid's query's explain not consistence with other Database
> ------------------------------------------------------------
>
> Key: TEIID-3842
> URL: https://issues.jboss.org/browse/TEIID-3842
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Affects Versions: 9.x
> Reporter: Kylin Soong
> Assignee: Kylin Soong
> Fix For: 9.x
>
>
> h2. The way to get execution plan is not consistence with others
> For most of RDBMS(Oracle, Mysql), the execution plan get via SQL query
> {code}
> explain select ...
> {code}
> But in Teiid, we need use Teiid API, and need enable showplan in advance:
> {code}
> statement.execute("set showplan on");
> ResultSet rs = statement.executeQuery("select ...");
> TeiidStatement tstatement = statement.unwrap(TeiidStatement.class);
> PlanNode queryPlan = tstatement.getPlanDescription();
> System.out.println(queryPlan);
> {code}
> Cache Hint can be added as prefix, so I think we can enhance that show plan also as prefix, in order for consistence with others.
> h2. The plan structure is too complex
> [1] is the query plan of dynamicvdb-datafederation which is 2 datasources' federation, it long, complex, for the users/customers, it's not easy for them to understand. So can we enhance that simplify the output, like add a format option that can output as matrix/table.
> [1] dynamicvdb-datafederation's 'select * from Stock' query plan
> {code}
> ProjectNode
> + Relational Node ID:0
> + Output Columns:
> 0: product_id (integer)
> 1: symbol (string)
> 2: price (bigdecimal)
> 3: company_name (string)
> + Statistics:
> 0: Node Output Rows: 9
> 1: Node Next Batch Process Time: 0
> 2: Node Cumulative Next Batch Process Time: 12
> 3: Node Cumulative Process Time: 21
> 4: Node Next Batch Calls: 3
> 5: Node Blocks: 2
> + Cost Estimates:Estimated Node Cardinality: -1.0
> + Child 0:
> JoinNode
> + Relational Node ID:1
> + Output Columns:
> 0: ID (integer)
> 1: symbol (string)
> 2: price (bigdecimal)
> 3: COMPANY_NAME (string)
> + Statistics:
> 0: Node Output Rows: 9
> 1: Node Next Batch Process Time: 4
> 2: Node Cumulative Next Batch Process Time: 12
> 3: Node Cumulative Process Time: 21
> 4: Node Next Batch Calls: 3
> 5: Node Blocks: 2
> + Cost Estimates:Estimated Node Cardinality: -1.0
> + Child 0:
> JoinNode
> + Relational Node ID:2
> + Output Columns:
> 0: symbol (string)
> 1: price (bigdecimal)
> + Statistics:
> 0: Node Output Rows: 10
> 1: Node Next Batch Process Time: 2
> 2: Node Cumulative Next Batch Process Time: 7
> 3: Node Cumulative Process Time: 7
> 4: Node Next Batch Calls: 2
> 5: Node Blocks: 1
> + Cost Estimates:Estimated Node Cardinality: -1.0
> + Child 0:
> ProjectNode
> + Relational Node ID:3
> + Output Columns:file (clob)
> + Statistics:
> 0: Node Output Rows: 1
> 1: Node Next Batch Process Time: 0
> 2: Node Cumulative Next Batch Process Time: 2
> 3: Node Cumulative Process Time: 2
> 4: Node Next Batch Calls: 1
> 5: Node Blocks: 0
> + Cost Estimates:Estimated Node Cardinality: -1.0
> + Child 0:
> AccessNode
> + Relational Node ID:4
> + Output Columns:
> 0: file (clob)
> 1: filePath (string)
> + Statistics:
> 0: Node Output Rows: 1
> 1: Node Next Batch Process Time: 2
> 2: Node Cumulative Next Batch Process Time: 2
> 3: Node Cumulative Process Time: 2
> 4: Node Next Batch Calls: 1
> 5: Node Blocks: 0
> + Cost Estimates:Estimated Node Cardinality: -1.0
> + Query:EXEC MarketData.getTextFiles('*.txt')
> + Model Name:MarketData
> + Select Columns:MarketData.getTextFiles.file
> + Child 1:
> TextTableNode
> + Relational Node ID:5
> + Output Columns:
> 0: symbol (string)
> 1: price (bigdecimal)
> + Statistics:
> 0: Node Output Rows: 10
> 1: Node Next Batch Process Time: 3
> 2: Node Cumulative Next Batch Process Time: 3
> 3: Node Cumulative Process Time: 3
> 4: Node Next Batch Calls: 2
> 5: Node Blocks: 1
> + Cost Estimates:Estimated Node Cardinality: -1.0
> + Table Function:TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) AS SP
> + Join Strategy:NESTED TABLE JOIN
> + Join Type:CROSS JOIN
> + Join Criteria
> + Child 1:
> AccessNode
> + Relational Node ID:6
> + Output Columns:
> 0: SYMBOL (string)
> 1: ID (integer)
> 2: COMPANY_NAME (string)
> + Statistics:
> 0: Node Output Rows: 25
> 1: Node Next Batch Process Time: 1
> 2: Node Cumulative Next Batch Process Time: 1
> 3: Node Cumulative Process Time: 17
> 4: Node Next Batch Calls: 5
> 5: Node Blocks: 4
> + Cost Estimates:Estimated Node Cardinality: -1.0
> + Query:SELECT g_0.SYMBOL AS c_0, g_0.ID AS c_1, g_0.COMPANY_NAME AS c_2 FROM Accounts.PRODUCT AS g_0 ORDER BY c_0
> + Model Name:Accounts
> + Join Strategy:ENHANCED SORT JOIN RAN AS SORT MERGE (SORT/ALREADY_SORTED)
> + Join Type:INNER JOIN
> + Join Criteria:SP.symbol=A.SYMBOL
> + Select Columns:
> 0: A.ID AS product_id
> 1: SP.symbol
> 2: SP.price
> 3: A.COMPANY_NAME AS company_name
> + Data Bytes Sent:0
> + Planning Time:128
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years
[JBoss JIRA] (TEIID-3846) Wrong alias rewriting in subqueries
by Salvatore R (JIRA)
Salvatore R created TEIID-3846:
----------------------------------
Summary: Wrong alias rewriting in subqueries
Key: TEIID-3846
URL: https://issues.jboss.org/browse/TEIID-3846
Project: Teiid
Issue Type: Bug
Reporter: Salvatore R
Assignee: Steven Hawkins
I defined two tables in PostgreSQL (but it's reproducible also in other databases like MySQL, for example) as follows:
{code:sql}
CREATE TABLE test_a
(
a integer,
b integer
);
CREATE TABLE test_b
(
b integer,
c integer
);
{code}
Running this query:
{code:sql}
SELECT
*
FROM
( SELECT
( SELECT x.a FROM pg.test_a AS x WHERE x.b = g_0.c ) AS c_2
FROM
pg.test_b AS g_0
) AS v_0
{code}
I get the following exception:
{code:sql}
13:11:30,073 WARN [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue50) 1iTDksSjXt1V Connector worker process failed for atomic-request=1iTDksSjXt1V.16.1.11: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT v_0.c_0 FROM (SELECT (SELECT g_1."a" FROM "public"."test_a" AS g_1 WHERE g_1."b" = g_1."c") AS c_0 FROM "public"."test_b" AS g_0) AS v_0]
at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:349)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_67]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_67]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_67]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]
at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
at com.sun.proxy.$Proxy47.execute(Unknown Source)
at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298)
at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)
at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]
at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
Caused by: org.postgresql.util.PSQLException: ERROR: column g_1.c does not exist
Position: 91
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123) [translator-jdbc-8.12.0.CR1.jar:8.12.0.CR1]
... 18 more
{code}
It seems that the problem is related to the alias "g_0" used for the source table "pg.test_b". In fact, if a different alias is used, the query runs without errors:
{code:sql}
SELECT
*
FROM
( SELECT
( SELECT x.a FROM pg.test_a AS x WHERE x.b = y.c ) AS c_2
FROM
pg.test_b AS y
) AS v_0
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years