[MCOL-5220] Query fail when using Null-safe equal comparison (Columnstore table only) Created: 2022-09-16  Updated: 2022-10-25

Status: Open
Project: MariaDB ColumnStore
Component/s: DMLProc
Affects Version/s: 6.4.2
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Majdi Bsoul Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Centos 7
MariaDB 10.8.4
Columnstore 6.4.3 (though it is not listed in affected versions, see releasenum below)



 Description   

The following query is auto generated by Tableau and uses Null-safe operator which fails with the error below. When changed to normal equal operator, it runs fine.
This is only happens for ColumnStore table. It is not an issue on MyISAM table.

MariaDB [com_db]> SELECT t0.hour_ct AS hour_ct, t0.temp0, t1.dimension_0,
-> t1.measure__1 AS sum_Calculation_1524749987192848385_ok
-> FROM (
-> SELECT hour_ct AS hour_ct,
> ADDDATE( DATE_FORMAT( hour_ct, '%Y%m-%d 00:00:00' ), INTERVAL 0 SECOND ) AS temp0
-> FROM com_db.DC_MNI_mvcore_video_hourly
-> WHERE ((hour_ct >= TIMESTAMP('2022-08-07 00:00:00')) AND (hour_ct < TIMESTAMP('2022-08-08 00:00:00')))
-> GROUP BY 1,2
-> ) t0
-> INNER JOIN (
> SELECT ADDDATE( DATE_FORMAT( hour_ct, '%Y%m-%d 00:00:00' ), INTERVAL 0 SECOND ) AS dimension_0,
-> COUNT(DISTINCT hour_ct) AS measure__1
-> FROM com_db.DC_MNI_mvcore_video_hourly
-> WHERE ((hour_ct >= TIMESTAMP('2022-08-01 00:00:00')) AND (hour_ct < TIMESTAMP('2022-08-08 00:00:00')))
-> GROUP BY 1
-> ) t1 ON (t0.temp0 <=> t1.dimension_0);
ERROR 1815 (HY000): Internal error: MCS-1000: 'sub-query' and 'sub-query' are not joined.
MariaDB [com_db]>
MariaDB [com_db]>
MariaDB [com_db]> SELECT t0.hour_ct AS hour_ct, t0.temp0, t1.dimension_0,
-> t1.measure__1 AS sum_Calculation_1524749987192848385_ok
-> FROM (
-> SELECT hour_ct AS hour_ct,
> ADDDATE( DATE_FORMAT( hour_ct, '%Y%m-%d 00:00:00' ), INTERVAL 0 SECOND ) AS temp0
-> FROM com_db.DC_MNI_mvcore_video_hourly
-> WHERE ((hour_ct >= TIMESTAMP('2022-08-07 00:00:00')) AND (hour_ct < TIMESTAMP('2022-08-08 00:00:00')))
-> GROUP BY 1,2
-> ) t0
-> INNER JOIN (
> SELECT ADDDATE( DATE_FORMAT( hour_ct, '%Y%m-%d 00:00:00' ), INTERVAL 0 SECOND ) AS dimension_0,
-> COUNT(DISTINCT hour_ct) AS measure__1
-> FROM com_db.DC_MNI_mvcore_video_hourly
-> WHERE ((hour_ct >= TIMESTAMP('2022-08-01 00:00:00')) AND (hour_ct < TIMESTAMP('2022-08-08 00:00:00')))
-> GROUP BY 1
-> ) t1 ON (t0.temp0 = t1.dimension_0);
-------------------------------------------------------------------------------------------------+

hour_ct temp0 dimension_0 sum_Calculation_1524749987192848385_ok

-------------------------------------------------------------------------------------------------+

2022-08-07 17:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 04:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 21:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 06:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 05:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 00:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 20:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 11:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 01:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 08:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 16:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 12:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 03:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 14:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 23:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 18:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 13:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 15:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 19:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 07:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 22:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 09:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 02:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24
2022-08-07 10:00:00 2022-08-07 00:00:00 2022-08-07 00:00:00 24

-------------------------------------------------------------------------------------------------+
24 rows in set (0.612 sec)

[root@f68eac01f002 columnstore]# pwd
/usr/share/columnstore
[root@f68eac01f002 columnstore]# cat releasenum
version=6.4.3
release=1


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