[MCOL-1674] Window functions have less significant digits Created: 2018-08-23  Updated: 2019-10-28  Resolved: 2019-08-29

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

Type: Bug Priority: Major
Reporter: David Hall (Inactive) Assignee: David Hall (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
PartOf
is part of MCOL-2161 Fix remaining errors in working_tpch1 Closed
Sprint: 2018-16, 2018-17, 2018-18, 2018-19, 2018-20, 2018-21, 2019-01, 2019-02, 2019-03, 2019-04, 2019-05, 2019-06

 Description   

See queries/working_tpch1/windowFunctions/bug5777.sql

For example:
Columnstore 1.1

MariaDB [tpch1]> SELECT start_ts, Query_time_sum,LAG(Query_time_sum) OVER(order by start_ts) prev_sum from query_class_metrics_float where agent_id=1 and query_class=1563 limit 50;
------------------------------------------------------

start_ts Query_time_sum prev_sum

------------------------------------------------------

2013-06-18 22:55:00 0.281992 NULL
2013-06-18 23:00:00 0.292305 0.28199198842048645
2013-06-18 23:05:00 0.215658 0.29230499267578125
2013-06-18 23:10:00 0.243597 0.21565799415111542
2013-06-18 23:15:00 0.35189 0.24359700083732605
2013-06-18 23:20:00 0.543079 0.3518899977207184
2013-06-18 23:25:00 0.495779 0.5430790185928345
2013-06-18 23:30:00 0.589326 0.49577900767326355
2013-06-18 23:35:00 0.210907 0.589326024055481
2013-06-18 23:40:00 0.167944 0.2109069973230362
2013-06-18 23:45:00 0.202401 0.16794399917125702

------------------------------------------------------
11 rows in set (0.174 sec)

Columnstore 1.2
MariaDB [tpch1]> SELECT start_ts, Query_time_sum,LAG(Query_time_sum) OVER(order by start_ts) prev_sum from query_class_metrics_float where agent_id=1 and query_class=1563 limit 50;
-------------------------------------------

start_ts Query_time_sum prev_sum

-------------------------------------------

2013-06-18 22:55:00 0.281992 NULL
2013-06-18 23:00:00 0.292305 0.281992
2013-06-18 23:05:00 0.215658 0.292305
2013-06-18 23:10:00 0.243597 0.215658
2013-06-18 23:15:00 0.35189 0.243597
2013-06-18 23:20:00 0.543079 0.35189
2013-06-18 23:25:00 0.495779 0.543079
2013-06-18 23:30:00 0.589326 0.495779
2013-06-18 23:35:00 0.210907 0.589326
2013-06-18 23:40:00 0.167944 0.210907
2013-06-18 23:45:00 0.202401 0.167944

-------------------------------------------
11 rows in set (0.22 sec)



 Comments   
Comment by David Hall (Inactive) [ 2018-08-27 ]

From MariaDB 10.3.8:
MariaDB [tpch1]> SELECT start_ts, Query_time_sum,LAG(Query_time_sum) OVER(order by start_ts) prev_sum from query_class_metrics_float where agent_id=1 and query_class=1563 limit 50;
------------------------------------------------------

start_ts Query_time_sum prev_sum

------------------------------------------------------

2013-06-18 22:55:00 0.281992 NULL
2013-06-18 23:00:00 0.292305 0.28199198842048645
2013-06-18 23:05:00 0.215658 0.29230499267578125
2013-06-18 23:10:00 0.243597 0.21565799415111542
2013-06-18 23:15:00 0.35189 0.24359700083732605
2013-06-18 23:20:00 0.543079 0.3518899977207184
2013-06-18 23:25:00 0.495779 0.5430790185928345
2013-06-18 23:30:00 0.589326 0.49577900767326355
2013-06-18 23:35:00 0.210907 0.589326024055481
2013-06-18 23:40:00 0.167944 0.2109069973230362
2013-06-18 23:45:00 0.202401 0.16794399917125702

------------------------------------------------------
11 rows in set (0.001 sec)

Comment by David Hall (Inactive) [ 2019-08-29 ]

LAG returns a previous row's value. Why should it be promoted to DOUBLE?

Comment by David Hall (Inactive) [ 2019-08-29 ]

Since the current behavior of Columnstore is more correct than that of MariaDB Server, and it appears to be some effort to change it, I'm closing this until (if) a customer complains. So far, no one has.

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