Saiku query shows no data - analytics

So, I installed pentaho bi server on my debian8 server. Then managed to install saiku on it. Now, I have used workbench to make a cube and published it into the server.
Here's the problem: when I access a saiku query, I DO can load my published cube, but when I try to navigate it, that is, establishing the measure and some dimension field in both columns and rows, NO DATA SHOWS!
And I know the database is not empty, thank you very much. Here is the fact_table, if it is helpful (the dimensions have the shown id's plus their own data, of course):
CREATE TABLE sc_fact_avi.fact_avi
(
id_fact bigserial NOT NULL,
id_empresa smallint,
id_cliente integer,
id_segmento bigint,
id_usuario bigint,
id_campana bigint,
id_resultado smallint,
id_telefono bigint,
id_fecha_llamada integer,
id_canal integer,
id_geografia integer,
id_hora_llamada integer,
id_hora_contestacion integer,
id_hora_inicio_asr integer,
id_hora_fin_asr integer,
id_hora_fin_llamada integer,
id_respuesta_p1 smallint,
id_respuesta_p2 smallint,
id_respuesta_p3 smallint,
id_respuesta_p4 smallint,
id_respuesta_p5 smallint,
id_respuesta_p6 smallint,
id_respuesta_p7 smallint,
id_respuesta_p8 smallint,
id_respuesta_p9 smallint,
id_respuesta_p10 smallint,
id_respuesta_p11 smallint,
id_respuesta_p12 smallint,
id_respuesta_p13 smallint,
id_respuesta_p14 smallint,
id_respuesta_p15 smallint,
link_grabacion character varying,
intento character(1),
cant_llamadas smallint DEFAULT 1,
CONSTRAINT pk_id_fact PRIMARY KEY (id_fact),
CONSTRAINT fk_id_campana FOREIGN KEY (id_campana)
REFERENCES sc_dim_avi.dim_campana (id_campana) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_canal FOREIGN KEY (id_canal)
REFERENCES sc_dim_avi.dim_canal (id_canal) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_cliente FOREIGN KEY (id_cliente)
REFERENCES sc_dim_avi.dim_cliente (id_cliente) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_empresa FOREIGN KEY (id_empresa)
REFERENCES sc_dim_avi.dim_empresa (id_empresa) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_fecha FOREIGN KEY (id_fecha_llamada)
REFERENCES sc_dim_avi.dim_fecha (id_fecha) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_fin_asr FOREIGN KEY (id_hora_fin_asr)
REFERENCES sc_dim_avi.dim_hora (id_hora) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_geografia FOREIGN KEY (id_geografia)
REFERENCES sc_dim_avi.dim_geografia (id_geografia) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_hora_fin_llamada FOREIGN KEY (id_hora_fin_llamada)
REFERENCES sc_dim_avi.dim_hora (id_hora) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_hora_llamada FOREIGN KEY (id_hora_llamada)
REFERENCES sc_dim_avi.dim_hora (id_hora) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_llamada_contestacion FOREIGN KEY (id_hora_contestacion)
REFERENCES sc_dim_avi.dim_hora (id_hora) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p1 FOREIGN KEY (id_respuesta_p1)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p10 FOREIGN KEY (id_respuesta_p10)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p11 FOREIGN KEY (id_respuesta_p11)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p12 FOREIGN KEY (id_respuesta_p12)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p13 FOREIGN KEY (id_respuesta_p13)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p14 FOREIGN KEY (id_respuesta_p14)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p15 FOREIGN KEY (id_respuesta_p15)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p2 FOREIGN KEY (id_respuesta_p2)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p3 FOREIGN KEY (id_respuesta_p3)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p4 FOREIGN KEY (id_respuesta_p4)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p5 FOREIGN KEY (id_respuesta_p5)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p6 FOREIGN KEY (id_respuesta_p6)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p7 FOREIGN KEY (id_respuesta_p7)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p8 FOREIGN KEY (id_respuesta_p8)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_respuesta_p9 FOREIGN KEY (id_respuesta_p9)
REFERENCES sc_dim_avi.dim_respuesta (id_respuesta) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_resultado_funcional FOREIGN KEY (id_resultado)
REFERENCES sc_dim_avi.dim_resultado (id_resultado) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_segmento FOREIGN KEY (id_segmento)
REFERENCES sc_dim_avi.dim_segmento (id_segmento) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_telefono FOREIGN KEY (id_telefono)
REFERENCES sc_dim_avi.dim_telefono (id_telefono) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_id_usuario FOREIGN KEY (id_usuario)
REFERENCES sc_dim_avi.dim_usuario (id_usuario) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT if_id_hora_inicio_asr FOREIGN KEY (id_hora_inicio_asr)
REFERENCES sc_dim_avi.dim_hora (id_hora) MATCH FULL
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
)
TABLESPACE ts_fact_avi;
ALTER TABLE sc_fact_avi.fact_avi
OWNER TO desarrollo;
I've tried modifying the cube from workbench several times and nothing. Here it is, I know it is not complete, but if it doesn't work with only a couple of tables, how will it with all of them (or maybe I'm calling the wrong fields?):
<Schema name="Schema_cubo">
<Dimension type="StandardDimension" visible="true" highCardinality="false" name="Campana">
<Hierarchy name="jerarquiaCampana" visible="true" hasAll="true" primaryKey="id_campana">
<Table name="dim_campana" schema="sc_dim_avi">
</Table>
<Level name="Campanas" visible="true" column="cd_campana" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
</Level>
</Hierarchy>
</Dimension>
<Dimension type="StandardDimension" visible="true" highCardinality="false" name="Cliente">
<Hierarchy name="jerarquiaCliente" visible="true" hasAll="true" primaryKey="id_cliente">
<Table name="dim_cliente" schema="sc_dim_avi">
</Table>
<Level name="Cliente" visible="true" column="cd_cliente" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
</Level>
</Hierarchy>
</Dimension>
<Cube name="Cubo_reporteadorprueba" visible="true" cache="true" enabled="true">
<Table name="fact_avi" schema="sc_fact_avi">
</Table>
<DimensionUsage source="Campana" name="Campana" visible="true" foreignKey="id_campana" highCardinality="false">
</DimensionUsage>
<DimensionUsage source="Cliente" name="Cliente" visible="true" foreignKey="id_cliente" highCardinality="false">
</DimensionUsage>
<Measure name="Cantidad_llamadas" column="cant_llamadas" datatype="Integer" aggregator="sum" visible="true">
</Measure>
</Cube>
</Schema>
Uninstalled and reinstalled saiku, yet nothing. I'm not sure if maybe just maybe, the pentaho bi server may not have been installed properly.
Is it because of different tablespaces? different schemas? Help!
Thank you for your replies and your time.
EDIT
I changed the cube (to the code now shown), and now it won't even show in the select cube option of saiku :/

It turned out that the most recent version of Pentaho BI server is not compatible with Saiku. I installed the previous stable version and now the saiku queries show the data.

Related

In the FK of the two tables, error to cycles or multiple cascade paths

enter image description here
The three tables have a FK relationship.
Post.PostBy is NOT NULL, Post.Category_id is Nullable.
An error has occurred.
Introducing FOREIGN KEY constraint 'FK_Post_Category' on table 'Post' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Could not create constraint or index. See previous errors.
ALTER TABLE [Category] ADD CONSTRAINT [FK_Category_CreatedBy] FOREIGN KEY ([CreatedBy])
REFERENCES [Account]([_id])
ON DELETE CASCADE
ALTER TABLE [Post] ADD CONSTRAINT [FK_Post_PostBy] FOREIGN KEY ([PostBy])
REFERENCES [Account]([_id])
ON DELETE CASCADE
ALTER TABLE [Post] ADD CONSTRAINT [FK_Post_Category_id] FOREIGN KEY ([Category_id])
REFERENCES [Category]([_id])
ON DELETE SET NULL
I don't understand.
PostBy is NOT NULL, so when the referenced row is deleted, we want it to be deleted along with it.
Category_id is NULLABLE, so if the reference row is deleted, set a NULL value.
Category and Post refer to Account, but I think it should work because they have different Account values.

Cannot add cascade on update on two column of table referencing to same table same column

I'm using SQL Server.
I have one table named PROGRAM_MASTER which has two columns created_by and updated_by which are referencing to USERS table on column id.
Now I want to define cascade on update option to both these columns using below SQL command.
alter table program_master add constraint program_master_created_by_foreign foreign key (created_by) references users (id) on update cascade
alter table program_master add constraint program_master_upated_by_foreign foreign key (updated_by) references users (id) on update cascade
But foreign key constraint gets added to created_by, but while creating one for updated_by I get following error.
SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL
Server]Introducing FOREIGN KEY constraint
'program_master_updated_by_foreign' on table 'program_master' may
cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or
ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
How should I resolve this error?

sqlplus error creating table with multiple foreign keys

So I am trying to create a table with multiple foreign keys however it keeps saying missing or invalid option. I have successfully created all the other tables that the keys reference without issue. What's strange is that I have found that the table creates if I remove either foreign key, but as soon as I have two foreign keys it gives me the error above. Any help is appreciated! :)
create table Class(
Class# int(5),
Class_Size int(30),
Module# char(5),
Student# char(4),
Constraint Class_PK primary key(Class#),
Constraint Class_Module_FK foreign key(Module#) references Modules(Module#) on delete cascade ),
Constraint Class_Student_FK foreign key(Student#) references Students(Student#) on delete cascade );
Looks like you have an extra ) at the end of second last line.
This should work
create table Class(
Class# int(5),
Class_Size int(30),
Module# char(5),
Student# char(4),
Constraint Class_PK primary key(Class#),
Constraint Class_Module_FK foreign key(Module#) references Modules(Module#) on delete cascade,
Constraint Class_Student_FK foreign key(Student#) references Students(Student#) on delete cascade );

cascade foreign key on multiple columns

I am trying to create UPDATE CASCADE Foreign key reference to a table using below scripts.I am getting error saying it may cause cycles or multiple cascade paths.
ALTER TABLE STA_STATIONARY_REQUEST_MASTER WITH CHECK ADD CONSTRAINT [FK_STA_STATIONARY_REQUEST_MASTER_REQUESTOR_ID] FOREIGN KEY([REQUESTOR_ID])
REFERENCES STA_EMPLOYEE_MASTER ([EMPLOYEE_ID])
ALTER TABLE STA_STATIONARY_REQUEST_MASTER WITH CHECK ADD CONSTRAINT [FK_STA_STATIONARY_REQUEST_MASTER_CREATED_BY] FOREIGN KEY([CREATED_BY])
REFERENCES STA_EMPLOYEE_MASTER ([EMPLOYEE_ID])
But when I am creating using below scripts it is created successfully.But still i am not able to update the employee id.
ALTER TABLE STA_STATIONARY_REQUEST_MASTER ADD CONSTRAINT
FK_STA_STATIONARY_REQUEST_MASTER_EMP1
FOREIGN KEY (REQUESTOR_ID) REFERENCES STA_EMPLOYEE_MASTER(EMPLOYEE_ID),
FOREIGN KEY (CREATED_BY) REFERENCES STA_EMPLOYEE_MASTER (EMPLOYEE_ID)
ON UPDATE CASCADE
Please help.

Error about CASCADE in Sql - Server 2008

I posted this problem yesterday and didn't get answer.
I attach here sample of my problem. I want to create this DB:
CREATE DATABASE [TRYShemen];
GO
USE [TRYShemen]
GO
CREATE TABLE Persons(
ID VARCHAR(50) PRIMARY KEY,
FullName VARCHAR(50) NOT NULL
);
CREATE TABLE Class(
ClassNum VARCHAR(30) PRIMARY KEY,
Teacher VARCHAR(50) NOT NULL,
constraint Class_FK foreign key (Teacher) references Persons (ID) ON DELETE NO ACTION ON UPDATE CASCADE,
);
CREATE TABLE Students(
StudentID VARCHAR(50) ,
ClassNum VARCHAR(30)
constraint Students_PK PRIMARY KEY (StudentID, ClassNum),
constraint Students_FK foreign key (StudentID) references Persons(ID) ON DELETE NO ACTION ON UPDATE CASCADE ,
constraint Students_FK1 foreign key (ClassNum) references Class(ClassNum) ON DELETE NO ACTION ON UPDATE CASCADE
);
and I get an error:
Introducing FOREIGN KEY constraint 'Students_FK1' on table 'Students' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
I know that if i change the 'Students_FK1' to ON CASCADE NO ACTION, it will work, but it's not my target. I want that if the id of 'Person' will update , it will update in the Students table too.
how can I solve it?
Thank You!!
So what can you do about it?
Consider this structure as an alternative.
table-Persons
table-Students
table-Teachers
table-Classes
table-Classes_to_Teachers
table-Classes_to_Students
Then you can have Cascading references for
Persons-->Students & Students-->Classes_to_Students
Persons-->Teachers & Teachers-->Classes_to_Teachers
When you access your data, you will have more joins to get all the data for one class.
But the constraints should work out.
Note that it says "may cause cycles or multiple cascade paths." If you follow a delete action through your ER diagram, you'll probably find that the delete action cascades to the same table via multiple routes.
In this case, imagine that the same person is both the teacher and the student in a class. Yes, I know, that's a logic error, but if that condition were true, then an update to that person would cascade to the students table via two routes.

Resources