I am using Pentaho 4.8 + Saiku adhoc 1.0, waiting for Saiku version 3.0 to be up and running in Pentaho 5.0
I am quite new to Pentaho and do not know how the SQL query is generated from Saiku Adhoc.
When using a very simple request involving 4 tables, the SQL query created is wrong.
When I test the query in the Query editor of Pentaho Metadata Editor, the result is correct using the 4 tables (so the metadata is good):
When designing the same query with Saiku Adhoc, one table is used twice and one is lacking:
This means that Postgresql in not able to process the query:
CET ERROR: missing FROM-clause entry for table "bt_res_partner_res_partner" at character 1742
I wonder where the problem comes from (in Saiku or anywhere else) and how to solve it.
Any help is welcome.
Thanks
I am quite new to Pentaho and do not know how the SQL query is generated from Saiku Adhoc.
When using a very simple request involving 4 tables, the SQL query created is wrong.
When I test the query in the Query editor of Pentaho Metadata Editor, the result is correct using the 4 tables (so the metadata is good):
Code:
SELECT DISTINCT
BT_PIR_PROJET_PIR_PROJET."name" AS COL0
,BT_PIR_AXE_PIR_AXE."name" AS COL1
,BT_RES_PARTNER_RES_PARTNER."name" AS COL2
FROM res_partner_ordered BT_RES_PARTNER_RES_PARTNER JOIN
(
pir_projet_structure BT_PIR_PROJET_STRUCTURE_PIR_PROJET_STRUCTURE JOIN
(
pir_projet_ordered BT_PIR_PROJET_PIR_PROJET LEFT OUTER JOIN pir_axe BT_PIR_AXE_PIR_AXE
ON ( BT_PIR_PROJET_PIR_PROJET.axe_id = BT_PIR_AXE_PIR_AXE.id )
)
ON ( BT_PIR_PROJET_STRUCTURE_PIR_PROJET_STRUCTURE.projet_id = BT_PIR_PROJET_PIR_PROJET.id )
)
ON ( BT_PIR_PROJET_STRUCTURE_PIR_PROJET_STRUCTURE.structure_id = BT_RES_PARTNER_RES_PARTNER.id )
Code:
SELECT DISTINCT
BT_PIR_PROJET_PIR_PROJET."name" AS COL0
,BT_RES_PARTNER_RES_PARTNER."name" AS COL1
,BT_PIR_AXE_PIR_AXE."name" AS COL2
FROM pir_projet_ordered BT_PIR_PROJET_PIR_PROJET JOIN
(
pir_projet_structure BT_PIR_PROJET_STRUCTURE_PIR_PROJET_STRUCTURE JOIN
(
pir_projet_ordered BT_PIR_PROJET_PIR_PROJET LEFT OUTER JOIN pir_axe BT_PIR_AXE_PIR_AXE
ON ( BT_PIR_PROJET_PIR_PROJET.axe_id = BT_PIR_AXE_PIR_AXE.id )
)
ON ( BT_PIR_PROJET_STRUCTURE_PIR_PROJET_STRUCTURE.structure_id = BT_RES_PARTNER_RES_PARTNER.id )
)
ON ( BT_PIR_PROJET_STRUCTURE_PIR_PROJET_STRUCTURE.projet_id = BT_PIR_PROJET_PIR_PROJET.id )
CET ERROR: missing FROM-clause entry for table "bt_res_partner_res_partner" at character 1742
I wonder where the problem comes from (in Saiku or anywhere else) and how to solve it.
Any help is welcome.
Thanks