1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-05-27 01:57:30 +03:00

95 Commits

Author SHA1 Message Date
Gagan Goel
2f1f9c0ef0 MDEV-25080 Some fixes:
1. In TupleUnion::writeNull(), add the missing switch case for
   wide decimal with 16bytes column width.
2. MCOL-5432 Disable complete/partial pushdown of UNION operation
   if the query involves an ORDER BY or a LIMIT clause, until
   MCOL-5222 is fixed. Also add MTR test cases for this.
2023-02-27 06:38:31 -05:00
Gagan Goel
e987a766e0 MDEV-25080 Some updates to the MDEV-25080 MTR test cases. 2023-02-27 06:38:31 -05:00
Gagan Goel
86dcf92d56 MCOL-5215 Fix overflow of UNION operation involving DECIMAL datatypes.
When a UNION operation involving DECIMAL datatypes with scale and digits
before the decimal exceeds the currently supported maximum precision
of 38, we throw an error to the user:
"MCS-2060: Union operation exceeds maximum DECIMAL precision of 38".

This is until MCOL-5417 is implemented where ColumnStore will have
full parity with MariaDB server in terms of maximum supported DECIMAL
precision and scale of 65 and 38 digits respectively.
2023-02-27 06:38:31 -05:00
Gagan Goel
45a779f743 MDEV-25080 Implement ColumnStore-side changes for pushdown of SELECT_LEX_UNITs. 2023-02-27 06:38:31 -05:00
Denis Khalikov
242bc75166 MCOL-5195 Correlated subquery with equi/non-equi scalar filter and join condition
Disable check for correlated subqueries, basically those types of queries transforms
to join (aggr(table2), table1), table2) and post join scalar filter.
2022-12-23 18:33:01 +03:00
root
2ed151fa59 Recorded reference results 2022-12-09 02:24:40 +00:00
root
c0d772559e Moved one more test case to 1pmonly folder 2022-12-02 14:30:43 +00:00
root
814fc37081 Moved some MTR cases to a new 1pmonly directory. Also added order by clause to few cases 2022-11-30 23:40:41 +00:00
mariadb-AndreyPiskunov
8b4be1b7f9 func json_arrayagg test adjustments 2022-11-02 16:07:45 +02:00
mariadb-AndreyPiskunov
33b09f5499 Add truncate for result consistency 2022-10-31 20:38:08 +03:00
mariadb-AndreyPiskunov
d7f4ec73c5 Small fixes + test sorting 2022-10-31 14:56:32 +02:00
mariadb-AndreyPiskunov
315e4be2d8 First working attempt for json_arrayagg 2022-10-31 14:56:32 +02:00
Daniel Lee
2606c91afd
Dlee 22.08.2 updates (#2578)
* Sort test result so the test case would pass

* Server message has been changes

* Added schema name in query for rows in test case only.  Also use lower case schema name

* Changed database to lower case

* Run test case in its own database to avoid table already exists error

Co-authored-by: root <root@rocky8.localdomain>
2022-10-05 16:56:57 -05:00
mariadb-AndreyPiskunov
80a2d8e9f5 Add tests for window functions 2022-09-30 18:26:37 +03:00
Jigao Luo
6c4af1461f
[MCOL-5205] Fix bug from union type in UNION processing.
This patch fixs the reported JIRA issue MCOL 5205, which consists of a wrong union type from two input Int types. The bug results in wrong unioned answers in CS. The fix includes more INT case discussions. Additionaly, this patch provides detailed unit tests for correctness in UNION processing with Int.

Signed-off-by: Jigao Luo <luojigao@outlook.com>
2022-09-09 22:54:35 +02:00
Ziy1-Tan
cdd41f05f3 MCOL-785 Implement DISTRIBUTED JSON functions
The following functions are created:
Create function JSON_VALID and test cases
Create function JSON_DEPTH and test cases
Create function JSON_LENGTH and test cases
Create function JSON_EQUALS and test cases
Create function JSON_NORMALIZE and test cases
Create function JSON_TYPE and test cases
Create function JSON_OBJECT and test cases
Create function JSON_ARRAY and test cases
Create function JSON_KEYS and test cases
Create function JSON_EXISTS and test cases
Create function JSON_QUOTE/JSON_UNQUOTE and test cases
Create function JSON_COMPACT/DETAILED/LOOSE and test cases
Create function JSON_MERGE and test cases
Create function JSON_MERGE_PATCH and test cases
Create function JSON_VALUE and test cases
Create function JSON_QUERY and test cases
Create function JSON_CONTAINS and test cases
Create function JSON_ARRAY_APPEND and test cases
Create function JSON_ARRAY_INSERT and test cases
Create function JSON_INSERT/REPLACE/SET and test cases
Create function JSON_REMOVE and test cases
Create function JSON_CONTAINS_PATH and test cases
Create function JSON_OVERLAPS and test cases
Create function JSON_EXTRACT and test cases
Create function JSON_SEARCH and test cases

Note:
Some functions output differs from MDB because session variables that affects functions output,e.g JSON_QUOTE/JSON_UNQUOTE
This depends on MCOL-5212
2022-08-30 22:22:23 +08:00
Sergey Zefirov
50d95bf60a
MCOL-5196 REPLACE function may trigger invalid capacity assertion (#2522)
When length of string to replace minus length of string to replace to is
bigger than input string and processing mode allows for binary (memcmp
or std::string::find()) comparison, REPLACE may trigger invalid capacity
assertion and query processing will stop.

The fix is to properly count the number of occurences of the string to
replace, basically.
2022-08-22 21:34:38 +03:00
david.hall
5c62d96b71 MCOL-5092 Use sorted_result to get consistent results in mtr 2022-08-17 09:07:47 -05:00
david.hall
5099133642 MCOL-5092 correct mtr result 2022-08-16 09:14:16 -05:00
david.hall
05bdddf3a9 MCOL-5092 addendum modify moda() mtr tests with order by
fix an issue in moda() evaluate for string types
2022-08-15 15:50:15 -05:00
Roman Nozdrin
56bbef62e6
Merge pull request #2406 from tntnatbry/MCOL-5021-dev
MCOL-5021 AUX column implementation to improve DELETE performance.
2022-08-15 19:03:42 +03:00
David.Hall
2020f35e88
Mcol 5092 MODA uses wrong column width for some types (#2450)
* MCOL-5092 Ensure column width is correct for datatype
                       Change MODA return type to STRING
                       Modify MODA to handle every numeric type
* MCOL-5162 MODA to support char and varchar with collation support

Fixes to the aggregate bit functions
When we fixed the storage sign issue for MCOL-5092, it uncovered a problem in the bit aggregates (bit_and, bit_or and bit_xor). These aggregates should always return UBIGINT, but they relied on the type of the argument column, which gave bad results.
2022-08-11 15:16:11 -05:00
Denis Khalikov
61cf18b92d [MCOL-5167] Add support for on clause filter for a table which is not involved in join.
This patch adds support for on clause filter for a table which is not involved in particular join
by disabling an `merge optimization` for those particular cases.
The `merge optimization` is optimization when CS
tries to create a one BPP join with one `large side` table and multiple `small sides` tables, in this
case we cannot apply a FE filter if this filter requires a columns from `small side` table which is not
involved in particular join.
2022-08-10 10:46:43 +00:00
Gagan Goel
0818b95caa MCOL-5021 Update MTR tests to reflect changes introduced by this feature. 2022-08-05 14:40:50 -04:00
mariadb-KirillPerov
e1199ea622
Update mcs78_aliases.result 2022-07-31 03:11:57 +03:00
mariadb-KirillPerov
5437ab0941
Update mcs171_null_functions.result 2022-07-31 01:13:10 +03:00
Roman Nozdrin
115c9db5e2
Merge pull request #2478 from drrtuy/temp-test-disable
This patch temporary disables the tests to get CI green.
2022-07-27 16:46:50 +03:00
Roman Nozdrin
23bb51c486 This patch temporary disables the tests to get CI green. 2022-07-27 09:32:44 +00:00
Denis Khalikov
e519cd7486
[MCOL-5061] Fix wrong join id assignment for the views. (#2474)
This patch fixes a wrong `join id` assignment for `TupleHashJoinStep` in a view.
After MCOL-334 CS assigns a '-1' as `join id` for `TupleHashJoinStep` in a view, and
in this case we cannot apply a filter for specific `Join step`, which is associated with `join id`
for 2 reasons:
1. Filters for all `TupleHashJoinSteps` associated with the same `join id`, which is '-1'.
2. When CS creates a `joinIdIndexMap` it eliminates all `join ids` which a less or equal 0.

This patch also fixes some tests for the view, which were generated wrong results.
2022-07-25 20:02:02 +03:00
Roman Nozdrin
627a4b5819
Revert "Debug mtr 20220720 (#2470)" (#2473)
This reverts commit 8b8ee98fd2b299bbc149545d368ed29de1c85b7e.

Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2022-07-23 13:50:14 +03:00
mariadb-KirillPerov
8b8ee98fd2
Debug mtr 20220720 (#2470)
* Update udf_calshowpartitions.test

* Update mcs_named_udfs.test

* Update udf_calshowpartitions.result

* Update mcs_named_udfs.result
2022-07-22 20:42:22 +03:00
Denis Khalikov
636e60b5f9 [MCOL-4699] Add support for circular outer joins. 2022-07-19 21:47:36 +03:00
Daniel Lee
7481f27343 Added order by clause to more queries 2022-07-12 09:49:24 -05:00
Daniel Lee
7ecf183af9 Added reference result files 2022-07-12 09:49:23 -05:00
mariadb-RomanNavrotskiy
194f0e9d64
ci: new builds grid, parallel steps 2022-07-08 22:30:02 +02:00
Roman Nozdrin
7d955a0f85 This patch fixes changed errno brought by the recent 10.8 changes 2022-07-02 17:12:50 +03:00
Andrey Piskunov
c7e67aedd9 Renamed variables + removed server tests 2022-06-03 15:30:25 +03:00
Andrey Piskunov
66c69c7609 Welford's algorithm STD and VAR on window functions 2022-06-03 15:29:30 +03:00
Andrey Piskunov
c5fa27475d Welford algorithm for STD and VAR
Naive algorithm for calculating STD and VAR is subject to catastrophic
cancellation. A well-known Welford's algorithms is used instead.
2022-06-03 15:29:30 +03:00
Commander thrashdin
f28e00c206 No repeating code in client_udfs + better test 2022-03-28 21:48:47 +03:00
Commander thrashdin
876a66cbc3 Added crude tests for cal/mcs client UDFs 2022-03-28 21:48:47 +03:00
Serguey Zefirov
53b9a2a0f9 MCOL-4580 extent elimination for dictionary-based text/varchar types
The idea is relatively simple - encode prefixes of collated strings as
integers and use them to compute extents' ranges. Then we can eliminate
extents with strings.

The actual patch does have all the code there but miss one important
step: we do not keep collation index, we keep charset index. Because of
this, some of the tests in the bugfix suite fail and thus main
functionality is turned off.

The reason of this patch to be put into PR at all is that it contains
changes that made CHAR/VARCHAR columns unsigned. This change is needed in
vectorization work.
2022-03-02 23:53:39 +03:00
Gagan Goel
973e5024d8 MCOL-4957 Fix performance slowdown for processing TIMESTAMP columns.
Part 1:
 As part of MCOL-3776 to address synchronization issue while accessing
 the fTimeZone member of the Func class, mutex locks were added to the
 accessor and mutator methods. However, this slows down processing
 of TIMESTAMP columns in PrimProc significantly as all threads across
 all concurrently running queries would serialize on the mutex. This
 is because PrimProc only has a single global object for the functor
 class (class derived from Func in utils/funcexp/functor.h) for a given
 function name. To fix this problem:

   (1) We remove the fTimeZone as a member of the Func derived classes
   (hence removing the mutexes) and instead use the fOperationType
   member of the FunctionColumn class to propagate the timezone values
   down to the individual functor processing functions such as
   FunctionColumn::getStrVal(), FunctionColumn::getIntVal(), etc.

   (2) To achieve (1), a timezone member is added to the
   execplan::CalpontSystemCatalog::ColType class.

Part 2:
 Several functors in the Funcexp code call dataconvert::gmtSecToMySQLTime()
 and dataconvert::mySQLTimeToGmtSec() functions for conversion between seconds
 since unix epoch and broken-down representation. These functions in turn call
 the C library function localtime_r() which currently has a known bug of holding
 a global lock via a call to __tz_convert. This significantly reduces performance
 in multi-threaded applications where multiple threads concurrently call
 localtime_r(). More details on the bug:
   https://sourceware.org/bugzilla/show_bug.cgi?id=16145

 This bug in localtime_r() caused processing of the Functors in PrimProc to
 slowdown significantly since a query execution causes Functors code to be
 processed in a multi-threaded manner.

 As a fix, we remove the calls to localtime_r() from gmtSecToMySQLTime()
 and mySQLTimeToGmtSec() by performing the timezone-to-offset conversion
 (done in dataconvert::timeZoneToOffset()) during the execution plan
 creation in the plugin. Note that localtime_r() is only called when the
 time_zone system variable is set to "SYSTEM".

 This fix also required changing the timezone type from a std::string to
 a long across the system.
2022-02-14 14:12:27 -05:00
Roman Nozdrin
a31066ff0e MCOL-4871 This patch adds relevant tests 2021-12-17 17:41:07 +00:00
Roman Nozdrin
83c0c84aea
This patch adds MTR's --sorted_result option to make the tests outputs deterministic (#2107) 2021-09-01 23:43:29 +03:00
David Hall
d1ef83c0f4 MCOL-3741 dev Change mtr IDB-xxx error codes to MCS-xxxx 2021-08-10 12:01:36 -05:00
Alexander Barkov
c16b0f6ad7
MCOL-4823 WHERE char_col<varchar_col returns a wrong result of a large table (#2060)
SCommand StrFilterCmd::duplicate() missed these two lines:

    filterCmd->leftColType = leftColType;
    filterCmd->rightColType = rightColType;

which exist in the parent's FilterCommand::duplicate().

Rewriting the code to avoid duplication by using more inherited
methods/constructors. This reduces the probability of similar bugs
in the future.
2021-08-03 11:53:05 +03:00
David.Hall
10cc1159a2
Merge pull request #2040 from tntnatbry/MCOL-641-move-mtr-tests
MCOL-641 Move MTR tests from future/ to basic/
2021-07-12 15:47:45 -05:00
Gagan Goel
78dbf3a7e1 MCOL-641 Move MTR tests from future/ to basic/ 2021-07-12 13:01:45 +00:00
Gagan Goel
3d557a2f1e
Merge pull request #2044 from dhall-MariaDB/MCOL-3738
MCOL-3738 COUNT(DISTINCT) with multiple parms
2021-07-12 07:34:56 -04:00