[
https://issues.jboss.org/browse/TEIID-2219?page=com.atlassian.jira.plugin...
]
Ivan Chan commented on TEIID-2219:
----------------------------------
Actually, I am still able to reproduce this problem. I can provide you my vdb if you can
show me how to export VDB from VDBRepository.
Here is my sql statements:
I was running 2 sql statements one right after the other. And I got exception in the 2nd
SQL statement.
1st SQL:
select
count("FoodmartDataSource_public_department"."department_description")
as "FoodmartDataSource_public_department_department_description_Count" from
"FoodmartDataSource_public"."department"
"FoodmartDataSource_public_department"
2nd SQL:
select
count("FoodmartDataSource_public_department"."department_description")
as "FoodmartDa
taSource_public_department_department_description_Count",
count("FoodmartDataSourceJNDI_public_employee"."gender") as
"FoodmartDataSourceJNDI_public_employee_
gender_Count"
from "FoodmartDataSource_public"."department"
"FoodmartDataSource_public_department"
inner join "FoodmartDataSourceJNDI_public"."employee"
"FoodmartDataSourceJNDI_public_employee" on ("
FoodmartDataSource_public_department"."department_id" =
"FoodmartDataSourceJNDI_public_employee"."de
partment_id")
Exception:
Caused by: com.jaspersoft.commons.dataset.DataSetException: Exception calling
JRDataSource.next() fo
r query select
count("FoodmartDataSource_public_department"."department_description")
as "FoodmartDa
taSource_public_department_department_description_Count",
count("FoodmartDataSourceJNDI_public_employee"."gender") as
"FoodmartDataSourceJNDI_public_employee_
gender_Count"
from "FoodmartDataSource_public"."department"
"FoodmartDataSource_public_department"
inner join "FoodmartDataSourceJNDI_public"."employee"
"FoodmartDataSourceJNDI_public_employee" on ("
FoodmartDataSource_public_department"."department_id" =
"FoodmartDataSourceJNDI_public_employee"."de
partment_id")
at
com.jaspersoft.commons.semantic.dsimpl.JRQueryDataSet$JRDataSetIterator.next(JRQueryDataS
et.java:300)
at com.jaspersoft.commons.datarator.CachedData.fetchData(CachedData.java:129)
... 101 more
Caused by: net.sf.jasperreports.engine.JRException: Error executing SQL statement for :
null
at
net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecute
r.java:240)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.cre
ateDatasource(JRTimezoneJdbcQueryExecuter.java:168)
at
com.jaspersoft.commons.util.JSControlledJdbcQueryExecuter.createDatasource(JSControlledJd
bcQueryExecuter.java:113)
at
com.jaspersoft.commons.semantic.dsimpl.JRQueryDataSet.getJRDataSource(JRQueryDataSet.java
:174)
at
com.jaspersoft.commons.semantic.dsimpl.JRQueryDataSet.access$100(JRQueryDataSet.java:44)
at
com.jaspersoft.commons.semantic.dsimpl.JRQueryDataSet$JRDataSetIterator.next(JRQueryDataS
et.java:291)
... 102 more
Caused by: org.teiid.jdbc.TeiidSQLException: org.teiid.core.TeiidException
at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:113)
at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:70)
at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:656)
at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:62)
at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:512)
at
org.teiid.client.util.ResultsFuture.addCompletionListener(ResultsFuture.java:139)
at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:508)
at
org.teiid.jdbc.PreparedStatementImpl.executeQuery(PreparedStatementImpl.java:211)
at
net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecute
r.java:233)
... 107 more
Caused by: org.teiid.core.TeiidException
at org.teiid.client.ResultsMessage.setException(ResultsMessage.java:172)
at
org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:787)
at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:483)
at
org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:318)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:49)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:219)
at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:386)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.teiid.transport.LocalServerConnection$1$1.call(LocalServerConnection.java:131)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:250)
at
org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:234)
at
org.teiid.transport.LocalServerConnection$1.invoke(LocalServerConnection.java:129)
at $Proxy130.executeRequest(Unknown Source)
at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:631)
at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:506)
... 109 more
Caused by: java.lang.NullPointerException
at
org.teiid.query.processor.relational.GroupingNode.initialize(GroupingNode.java:185)
at
org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:1
08)
at
org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:1
13)
at
org.teiid.query.processor.relational.RelationalPlan.initialize(RelationalPlan.java:103)
at org.teiid.query.processor.QueryProcessor.init(QueryProcessor.java:194)
at
org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:130)
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:109)
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:153)
at
org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:382)
at
org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:291)
... 125 more
NullPointer Exception when doing count aggregations on two individual
columns from separate databases
-----------------------------------------------------------------------------------------------------
Key: TEIID-2219
URL:
https://issues.jboss.org/browse/TEIID-2219
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.1
Environment: Running embedded mode
Reporter: Ivan Chan
Assignee: Steven Hawkins
I have issues doing Count aggregations in 2 different databases. 2 out of 3 following
cases fail... (But distinct count seems ok)
<----------- CASE 1 ----------> SUM first, then COUNT => OK
SUM(DB_2.field_1), COUNT(DB_1.field_1)
select sum("FoodmartDataSourceJNDI_public_expense_fact"."amount") as
"FoodmartDataSourceJNDI_public_expense_fact_amount_Sum",
count("FoodmartDataSource_public_employee"."full_name") as
"FoodmartDataSource_public_employee_full_name_Count"
from "FoodmartDataSource_public"."employee"
"FoodmartDataSource_public_employee"
inner join "FoodmartDataSourceJNDI_public"."expense_fact"
"FoodmartDataSourceJNDI_public_expense_fact" on
("FoodmartDataSource_public_employee"."store_id" =
"FoodmartDataSourceJNDI_public_expense_fact"."store_id")
SELECT g_0."store_id" AS c_0, g_0."full_name" AS c_1 FROM
"public"."employee" AS g_0 ORDER BY c_0
SELECT g_0."store_id" AS c_0, SUM(g_0."amount") AS c_1 FROM
"public"."expense_fact" AS g_0 GROUP BY g_0."store_id" ORDER
BY c_0
<-----------CASE 2 ---------------> COUNT first, then SUM => ERROR
COUNT(DB_1.field_1), SUM(DB_2.field_1)
select
count("FoodmartDataSourceJNDI_public_expense_fact"."category_id") as
"FoodmartDataSourceJNDI_public_expense_fact_category_id_Count",
sum("FoodmartDataSource_public_employee"."salary") as
"FoodmartDataSource_public_employee_salary_Sum"
from "FoodmartDataSource_public"."employee"
"FoodmartDataSource_public_employee"
inner join "FoodmartDataSourceJNDI_public"."expense_fact"
"FoodmartDataSourceJNDI_public_expense_fact" on
("FoodmartDataSource_public_employee"."store_id" =
"FoodmartDataSourceJNDI_public_expense_fact"."store_id")
Caused by: java.lang.NullPointerException
at
org.teiid.query.processor.relational.GroupingNode.initialize(GroupingNode.java:184)
at
org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:108)
at
org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:113)
at
org.teiid.query.processor.relational.RelationalPlan.initialize(RelationalPlan.java:103)
at org.teiid.query.processor.QueryProcessor.init(QueryProcessor.java:194)
at
org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:130)
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:109)
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:153)
at
org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:382)
at
org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:291)
... 123 more
<-----------CASE 3 ---------------> COUNT on DB1.COL1 and COUNT on DB2.COL2 =>
ERROR
COUNT(DB_1.field_1), COUNT(DB_2.field_1)
select
count("FoodmartDataSourceJNDI_public_expense_fact"."category_id") as
"FoodmartDataSourceJNDI_public_expense_fact_category_id_Count",
count("FoodmartDataSource_public_employee"."first_name") as
"FoodmartDataSource_public_employee_first_name_Count"
from "FoodmartDataSource_public"."employee"
"FoodmartDataSource_public_employee"
inner join "FoodmartDataSourceJNDI_public"."expense_fact"
"FoodmartDataSourceJNDI_public_expense_fact" on
("FoodmartDataSource_public_employee"."store_id" =
"FoodmartDataSourceJNDI_public_expense_fact"."store_id")
Caused by: java.lang.NullPointerException
at
org.teiid.query.processor.relational.GroupingNode.initialize(GroupingNode.java:184)
at
org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:108)
at
org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:113)
at
org.teiid.query.processor.relational.RelationalPlan.initialize(RelationalPlan.java:103)
at org.teiid.query.processor.QueryProcessor.init(QueryProcessor.java:194)
at
org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:130)
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:109)
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:153)
at
org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:382)
at
org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:291)
... 123 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira