[MCOL-358] Error in Cross Engine Join Query Created: 2016-10-13  Updated: 2016-11-29  Resolved: 2016-11-29

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: 1.0.3
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Kumar Saurav Sonu Assignee: David Thompson (Inactive)
Resolution: Not a Bug Votes: 0
Labels: None

Attachments: PNG File FullScenario.png     JPEG File showgrantqueryoutput.jpg     JPEG File showgrantsforuseroutput.jpg     PNG File userandhostconfiguredincrossjoin.png    
Sprint: 2016-22, 2016-23

 Description   

I am getting below error on performing cross engine query in mariadb columnstore.
ERROR 1815 (HY000): Internal error: fatal error executing query in crossengine client lib(17)(17)

My query is :-
SELECT a.id stoppage_id, a.machine stoppage_machine, MIN(kf.timestamp) stoppage_end FROM kpi_fact kf, ( SELECT sr.id, sr.machine, sr.start_time FROM stoppage_reason sr, stoppage_configuration sc WHERE sr.start_time BETWEEN '2016-10-13 16:05:15' AND '2016-10-13 16:05:15' AND sr.end_time IS NULL AND sc.machine = sr.machine AND sc.with_end_timestamp = false) a WHERE a.machine = kf.machine AND LOWER(kf.kpi_name) = 'machine_up_status' AND kf.kpi_value_integer = 1 AND kf.global_parameter = 0 AND kf.timestamp > a.start_time GROUP BY a.machine, a.id ;

In the above query there is cross engine join between :-
kpi_fact(Columnstore) ,stoppage_reason and stoppage_master(MyISAM)

I am getting ERROR 1815 (HY000): Internal error: fatal error executing query in crossengine client lib(17)(17) because inner select( SELECT sr.id, sr.machine, sr.start_time FROM stoppage_reason sr, stoppage_configuration sc WHERE sr.start_time BETWEEN '2016-10-13 16:05:15' AND '2016-10-13 16:05:15' AND sr.end_time IS NULL AND sc.machine = sr.machine AND sc.with_end_timestamp = false results in empty set.

When i insert some dummy data in this table :- insert into stoppage_configuration values (1, 'Bleh',0,1,1,1,1);
Below Query Starts working fine
SELECT a.id stoppage_id, a.machine stoppage_machine, MIN(kf.timestamp) stoppage_end FROM kpi_fact kf, ( SELECT sr.id, sr.machine, sr.start_time FROM stoppage_reason sr, stoppage_configuration sc WHERE sr.start_time BETWEEN '2016-10-13 16:05:15' AND '2016-10-13 16:05:15' AND sr.end_time IS NULL AND sc.machine = sr.machine AND sc.with_end_timestamp = false) a WHERE a.machine = kf.machine AND LOWER(kf.kpi_name) = 'machine_up_status' AND kf.kpi_value_integer = 1 AND kf.global_parameter = 0 AND kf.timestamp > a.start_time GROUP BY a.machine, a.id ;

Thanks,
Saurav



 Comments   
Comment by David Thompson (Inactive) [ 2016-10-13 ]

Hi Saurav,
It is most likely because you are missing a grant to the infinidb_vtable database for the user you are connecting as. I have added a troubleshooting section to the knowledge base article on cross engine joins, please confirm if this resolves the issue:
https://mariadb.com/kb/en/mariadb/configuring-columnstore-cross-engine-joins/

Comment by Kumar Saurav Sonu [ 2016-10-14 ]

Hi David,

I have tried the method suggested by you but it is still not working.

Please find below the simple steps to reproduce the issue.
1)Create a table :-
CREATE TABLE `student` (
`name` varchar(255) NOT NULL,
`id` bigint(20) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1

2)Create another table :-
CREATE TABLE `birth_information` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`birth_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

3)Now run the below query :-

SELECT st.name student_name FROM student st, ( SELECT bi.id,bi.birth_time FROM birth_information bi WHERE bi.birth_time BETWEEN '2016-10-13 16:05:15' AND '2016-10-13 16:05:15') a WHERE a.id = st.id;

It will throw ERROR 1815 (HY000): Internal error: fatal error executing query in crossengine client lib(17)(17)

Let me know if you have any issue recreating the same.

Thanks,
Saurav

Comment by David Thompson (Inactive) [ 2016-10-14 ]

Can you confirm:
1. What user are you running the above commands as
2. What user and host are configured in the cross engine join config.
3. what does show grants for <user> in 2 return. It should include something like (where ce is my user in 2 above):
GRANT CREATE TEMPORARY TABLES ON `infinidb_vtable`.* TO 'ce'@'127.0.0.1'
4. What version you are running, i assume 1.0.3?

With your schema i am able to make this work.

Comment by Kumar Saurav Sonu [ 2016-10-15 ]

Hi David,
Above schema with query B(See below) i have created to represent my original problem which was Query A(see below) in a simplistic manner.
When you said that with this schema you were able to run this.I also immediately log into mscmysql console and ran the query B and to my surprise it worked.Then i ran the orginal query A and it failed,then i again run the query B and it is failing now.Please see the attached file Fullsceanrio.jpg for detail.

Two queries mentioned above are :-
A-> SELECT a.id stoppage_id FROM kpi_fact kf, ( SELECT sr.id, sr.machine, sr.start_time FROM stoppage_reason sr, stoppage_configuration sc WHERE sr.start_time BETWEEN '2016-10-13 16:05:15' AND '2016-10-13 16:05:15' AND sc.machine = sr.machine) a WHERE a.machine = kf.machine;

B->SELECT st.name student_name FROM student st, ( SELECT bi.id,bi.birth_time FROM birth_information bi WHERE bi.birth_time BETWEEN '2016-10-13 16:05:15' AND '2016-10-13 16:05:15') a WHERE a.id = st.id;

Your question answers are :-
1. What user are you running the above commands as
A. I am running above command as covacsis user
2. What user and host are configured in the cross engine join config.
A.Please see screenshot userandhostconfiguredincrossjoin.jpg attached.
3. what does show grants for <user> in 2 return. It should include something like (where ce is my user in 2 above):
GRANT CREATE TEMPORARY TABLES ON `infinidb_vtable`.* TO 'ce'@'127.0.0.1'
A. Please see showgrantqueryoutput.jpg attached.
4. What version you are running, i assume 1.0.3?
A. yes my version is MariaDB Columnstore 1.0.3-1,you can see in screenshot also.

Comment by David Thompson (Inactive) [ 2016-10-15 ]

That is strange.. Would you mind sharing the schema / create tables for the tables for query A, i.e stoppage_reason etc?

Another way to troubleshoot is to run the query as your covacsis user as that may surface some permission issues since the non column store queries are run as that user.

Comment by Kumar Saurav Sonu [ 2016-10-15 ]

Hi David,

I have tried running my query A as both covacsis and root user but then also it is giving the same error.

Please find below scheama/create tables for the query A :-
1)kpi_fact :- CREATE TABLE `kpi_fact` (
`id` varchar(255) NOT NULL,
`batch_status` varchar(255) DEFAULT NULL,
`global_parameter` tinyint(4) DEFAULT NULL,
`kpi_name` varchar(255) DEFAULT NULL,
`kpi_value_boolean` tinyint(4) DEFAULT NULL,
`kpi_value_double` double DEFAULT NULL,
`kpi_value_integer` bigint(20) DEFAULT NULL,
`kpi_value_map` varchar(255) DEFAULT NULL,
`kpi_value_string` varchar(255) DEFAULT NULL,
`time_slice_size` int(11) DEFAULT NULL,
`timestamp` datetime NOT NULL,
`batch_id` bigint(20) DEFAULT NULL,
`batch_machine` bigint(20) DEFAULT NULL,
`date` bigint(20) DEFAULT NULL,
`machine` bigint(20) DEFAULT NULL,
`machine_group` bigint(20) DEFAULT NULL,
`product` bigint(20) DEFAULT NULL,
`time_of_day` bigint(20) DEFAULT NULL,
`batch_no` varchar(255) DEFAULT NULL,
`machine_name` varchar(255) DEFAULT NULL,
`product_name` varchar(255) DEFAULT NULL,
`day_of_month` int(11) DEFAULT NULL,
`month` int(11) DEFAULT NULL,
`year` int(11) DEFAULT NULL,
`day_of_week` int(11) DEFAULT NULL,
`quarter` int(11) DEFAULT NULL,
`kpi_id` bigint(20) DEFAULT NULL,
`kpi_data_type` varchar(255) DEFAULT NULL,
`kpi_unit_id` bigint(20) DEFAULT NULL,
`kpi_unit_name` varchar(255) DEFAULT NULL,
`display_unit_id` bigint(20) DEFAULT NULL,
`display_unit_name` varchar(255) DEFAULT NULL,
`standard` double DEFAULT NULL,
`shift_start` bigint(20) DEFAULT NULL,
`shift_end` bigint(20) DEFAULT NULL,
`visible` tinyint(4) DEFAULT NULL,
`kpi_dimension_machine` tinyint(4) DEFAULT NULL,
`kpi_dimension_batch` tinyint(4) DEFAULT NULL,
`kpi_dimension_product` tinyint(4) DEFAULT NULL,
`dummy1` tinyint(4) DEFAULT NULL,
`dummy2` tinyint(4) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1

2) stoppage_reason :-
CREATE TABLE `stoppage_reason` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`end_time` datetime DEFAULT NULL,
`link` varchar(255) DEFAULT NULL,
`start_time` datetime DEFAULT NULL,
`machine` bigint(20) DEFAULT NULL,
`reason` int(11) DEFAULT NULL,
`end_date` bigint(20) DEFAULT NULL,
`end_time_of_day` bigint(20) DEFAULT NULL,
`start_date` bigint(20) DEFAULT NULL,
`start_time_of_day` bigint(20) DEFAULT NULL,
`remark` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_c7s3fqp55e83j80j6rjx27pvk` (`machine`),
KEY `FK_s0pxnff4v6ahbnt44sypufha2` (`reason`),
KEY `FK_q5pnyeyhvdf2387l4194v5peb` (`end_date`),
KEY `FK_f2l8h7te2tine5n588nurjk56` (`end_time_of_day`),
KEY `FK_lg1p51a470a6qdyno7s4n9sir` (`start_date`),
KEY `FK_oevryf9pbj9jxpa1876g2cs6e` (`start_time_of_day`)
) ENGINE=MyISAM AUTO_INCREMENT=31636 DEFAULT CHARSET=latin1

3)stoppage_configuration :- CREATE TABLE `stoppage_configuration` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`inflow_type` varchar(255) DEFAULT NULL,
`off_signal` int(11) NOT NULL,
`on_signal` int(11) NOT NULL,
`with_end_timestamp` bit(1) NOT NULL,
`machine` bigint(20) DEFAULT NULL,
`stoppage_end_kpi` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_kwt5fourhl2325yg3upqfixja` (`machine`),
KEY `FK_25vu778yf1xafuh9avgcldenw` (`stoppage_end_kpi`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Let me know if you need any more info.

Comment by David Thompson (Inactive) [ 2016-10-16 ]

I used your schema and put in some data and everything is fine. Can you redo the screenshot for 3 / show grants for <user> as the screenshot is just showing the users table?

Comment by Kumar Saurav Sonu [ 2016-10-17 ]

Hi David,

Please find the showgrantsforuseroutput.jpg attached.And one more information i want you to give is that i have installed MariaDB in virtualbox(ubuntu 16.04).Is query failing has any thing to do with Virtual Box Installation.

Comment by David Thompson (Inactive) [ 2016-10-17 ]

Try changing your grant to be GRANT CREATE TEMPORARY TABLES ON `infinidb_vtable`.* TO 'covacsis'@'127.0.0.1' . Right now you have this permission granted to covacsis@localhost and you are using 127.0.0.1 in the config in columnstore.xml. These need to be aligned.

Comment by David Thompson (Inactive) [ 2016-11-29 ]

Due to lack of response, assuming this resolved the issue. Please re-open if you are still having issues.

Generated at Thu Feb 08 02:20:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.