1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-18 21:44:02 +03:00

87 Commits

Author SHA1 Message Date
Serguey Zefiov
8b9db66ddd fix(MCOL-5889): Improper handle of DOUBLE result type with DECIMAL arguments
Sometimes server assigns DOUBLE type for arithmetic operations over
DECIMAL arguments. In this rare case width of result was incorrectly
adjusted and it triggered an assertion.

Now width of result gets adjusted only if result type is also DECIMAL.
2025-02-12 12:26:09 +03:00
Sergey Zefirov
3bc8bd8cc6
fix(group by, having): MCOL-5776: GROUP BY/HAVING closer to server's (#3257)
This patch introduces an internal aggregate operator SELECT_SOME that
is automatically added to columns that are not in GROUP BY. It
"computes" some plausible value of the column (actually, last one
passed).

Along the way it fixes incorrect handling of HAVING being transferred
into WHERE, window function handling and a bit of other inconsistencies.
2024-12-20 19:12:32 +00:00
Serguey Zefirov
38fd96a663 fix(memory leaks): MCOL-5791 - get rid of memory leaks in plugin code
There were numerous memory leaks in plugin's code and associated code.
During typical run of MTR tests it leaked around 65 megabytes of
objects. As a result they may severely affect long-lived connections.

This patch fixes (almost) all leaks found in the plugin. The exceptions
are two leaks associated with SHOW CREATE TABLE columnstore_table and
getting information of columns of columnstore-handled table. These
should be fixed on the server side and work is on the way.
2024-12-04 10:59:12 +03:00
drrtuy
8ae5a3da40
Fix/mcol 5787 rgdata buffer max size dev (#3325)
* fix(rowgroup): RGData now uses uint64_t counter for the fixed sizes columns data buf.
	The buffer can utilize > 4GB RAM that is necessary for PM side join.
	RGData ctor uses uint32_t allocating data buffer.
 	This fact causes implicit heap overflow.

* feat(bytestream,serdes): BS buffer size type is uint64_t
	This necessary to handle 64bit RGData, that comes as
	a separate patch. The pair of patches would allow to
	have PM joins when SmallSide size > 4GB.

* feat(bytestream,serdes): Distribute BS buf size data type change to avoid implicit data type narrowing

* feat(rowgroup): this returns bits lost during cherry-pick. The bits lost caused the first RGData::serialize to crash a process
2024-11-09 19:44:02 +00:00
Leonid Fedorov
eeac2addd2 MTR runner improved 2024-08-28 16:27:02 +04:00
Leonid Fedorov
75f95d3a6b helper to install foundationdb locally 2024-08-19 00:32:12 +04:00
Leonid Fedorov
0d1c72a563 compilation fix for gcc12 on known gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 2024-01-04 11:43:03 +03:00
Roman Nozdrin
eb744eafed chore(datatypes): this refactors the placement of the main SQL data types enum to enable templates that are parametrized with this enum(see mcs_datatype_basic.h changes for more details). 2023-10-24 18:44:35 +03:00
Leonid Fedorov
8171e9da07
Fix rocky-8 vanilla compiler build (#2959)
Co-authored-by: Leonid Fedorov <leonid.fedorov@mariad.com>
2023-09-20 04:04:08 +03:00
Leonid Fedorov
70111eba3d
chore(external-libs): remove unused pattern matching lib b/c the standard will presumably use a different implementation for pattern matching. 2023-09-12 12:04:34 +03:00
Leonid Fedorov
8f93fc3623
MCOL-5493: First portion of UBSan fixes (#2842)
Multiple UB fixes
2023-06-02 17:02:09 +03:00
Leonid Fedorov
3ce19abdae
Options to build with TSAN, UBSAN and skipping smoke (#2826) 2023-04-21 21:24:48 +03:00
Leonid Fedorov
2e1394149b
MCOL-5464: Fixes of bugs from ASAN warnings, part one (#2792)
* Fixes of bugs from ASAN warnings, part one

* MQC as static library, with nifty counter for global map and mutex

* Switch clang to 16

* link messageqcpp to execplan
2023-04-04 02:33:23 +03:00
Sergey Zefirov
b53c231ca6 MCOL-271 empty strings should not be NULLs (#2794)
This patch improves handling of NULLs in textual fields in ColumnStore.
Previously empty strings were considered NULLs and it could be a problem
if data scheme allows for empty strings. It was also one of major
reasons of behavior difference between ColumnStore and other engines in
MariaDB family.

Also, this patch fixes some other bugs and incorrect behavior, for
example, incorrect comparison for "column <= ''" which evaluates to
constant True for all purposes before this patch.
2023-03-30 21:18:29 +03:00
Andrey Piskunov
256691652d
MCOL-4530: toCppCode() method for ParseTree and TreeNode (#2777)
* toCppCode for ParseTree and TreeNode

* generated tree is compiling

* Put tree constructors into tests

* Minor fixes

* Fixed parse + some constructors

* Fixed includes, removed debug and old data

* Hopefully fix clang errors

* Forgot an override

* More overrides
2023-03-22 23:25:06 +03:00
Andrey Piskunov
b6808c97f1
MCOL-4530: common conjuction top rewrite (#2673)
Added logical transformation of the execplan::ParseTrees with the taking out the common factor in expression of the form "(A and B) or (A and C)" for the purposes of passing a TPCH 19 query.

Co-authored-by: Leonid Fedorov <leonid.fedorov@mariadb.com>
2023-02-27 19:23:19 +03:00
Andrey Piskunov
8671f55784
MCOL-5333: Full MTR tests for custom Build (#2732)
* Add MTR_SUITE_LIST

* Typo

* Add data download

* Install tar and lz4

* Change the way MTR_SUITE_LIST is set up

* Use bash for MTR_SUITE_LIST

* Another one

* Fix reference results for full MTR develop, disable broken JSON test and tests with 10GB database

* Fix timestamps and truncate cos

* Fix some more references

* Fix dokcerhub step for custom build

* One more fix for dockerhub step on custom build

* Fix tests for regr functions with truncate

* Full mtr set on nghtly + MTR_FULL_SET flag

* One more fix for dockerhub

* Fix MTR_FULL_SET

* Testing MTR_FULL_SET

* sorted_result in tests + fix typo

* Truncate even more

* Typo

* truncate 2 more tests

* Disable regr_* functions tests

* fix setup mtr step

* correct settings for table creation

* Put setup for tests into drone

* Fix for debian based distros

* More truncates

* Disable the rest

---------

Co-authored-by: Leonid Fedorov <leonid.fedorov@mariadb.com>
2023-02-27 13:42:48 +03:00
Leonid Fedorov
f7118b53a8
Turn on ASAN for unitests (#2719)
Fix asan error on compression tests
Fix warn of nonreturn function
2023-02-02 15:08:01 +02:00
Roman Nozdrin
9746a2572b
This commit adds pattern match feature using MPark's library (#2665) 2022-12-20 19:00:32 +03:00
Leonid Fedorov
37fd915a08 Serg`s patch for develop-6 revised for develop https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/2614 2022-11-09 22:41:38 +00:00
NTH19
7d76dc4534 AUX column scan(MCOL-5021) effectively disables vectorized scanning on
ARM platforms. This patch resolves this issue and unifies AUX column
processing at x86 and ARM using tempate class SimdProcessor.
The patch also replaces uint16_t mask previously used in column.cpp and
SimProcessor code with a native masks that platform uses, e.g. __m128i
or __m128 on x86 and variety of masks on ARM.
To unify the processing I introduced a new filtering Compare Operator - COMPARE_NULLEQ.
with a 'c1 IS NULL semantics'.
2022-10-07 10:32:54 +00:00
NTH19
3ef706b054 fix micro benchmark 2022-08-29 19:30:45 +08:00
mariadb-AndreyPiskunov
0863ecd279 Replace getBinaryField 2022-08-25 18:21:43 +03:00
Sergei Golubchik
a7a9ccf889
Serg dev (#2504)
* more build dependencies

* fix for cmake < 3.11

It cannot do ADD_LIBRARY(... ALIAS ...) on IMPORTED targets

* another fix for cmake 3.10.2

It doesn't know about CMAKE_CXX_STANDARD=20,
let's add the correct flag manually

* gcc 8 on aarch64

utils/common/simd_arm.h:241:16: error: need ‘typename’ before ‘simd::TypeToVecWrapperType<T>::WrapperType’ because ‘simd::TypeToVecWrapperType<T>’ is a dependent scope
2022-08-15 13:35:30 +03:00
Roman Nozdrin
f40175dc32 This patch solves the ocassional issues with the FairThreadPool unit test 2022-08-11 16:56:17 +00:00
Roman Nozdrin
a9d8924683 MCOL-5166 This patch adds support for in-memory communication b/w EM to PP via a shared queue in DEC class
JobList low-level code relateod to primitive jobs now uses shared pointers instead of ByteStream refs talking to DEC
b/c same-node EM-PP communication now goes over a queue in DEC instead of a network hop.
PP now has a separate thread that processes the primitive job messages from that DEC queue.
2022-08-04 18:51:31 +03:00
NTH19
19ca844cd1 support_max_min 2022-08-04 16:16:38 +03:00
Andrey Piskunov
589b786fda Don't ignore null or empty in calculation 2022-08-04 16:16:38 +03:00
Andrey Piskunov
04ac04ff74 Temporary test fix 2022-08-04 16:16:38 +03:00
Andrey Piskunov
5c6cd2cca3 use vect update for everything except TEXT 2022-08-04 16:16:38 +03:00
Andrey Piskunov
225f54fd79 Tests for simd min/max 2022-08-04 16:16:38 +03:00
Andrey Piskunov
b8200acd3b Don't ignore null or empty in calculation 2022-08-04 16:16:38 +03:00
Andrey Piskunov
2a7da39610 Temporary test fix 2022-08-04 16:16:38 +03:00
Andrey Piskunov
c4df7925d1 use vect update for everything except TEXT 2022-08-04 16:16:38 +03:00
Andrey Piskunov
1681edaca0 Tests for simd min/max 2022-08-04 16:16:38 +03:00
Roman Nozdrin
3b87532413 Revert "This patch disables FairThreadPool to double check if this feature contributes to multiple strange side-effects and ocassional failed MTR tests"
This reverts commit b78cbffa934794bbbf3f6cd5309bf481e90d6648.
2022-07-22 14:04:06 +00:00
Roman Nozdrin
b78cbffa93 This patch disables FairThreadPool to double check if this feature contributes to multiple strange side-effects and ocassional failed MTR tests 2022-07-20 11:17:19 +00:00
Leonid Fedorov
1cd382ba3b Clang warning fix 2022-07-16 16:26:10 +03:00
Leonid Fedorov
140770d6f4 Delete tests/shared_components_tests.cpp, erase legacy code from tests/primitives_scan_bench.cpp, option to run benchmarks from build/bootstrap_mcs.sh 2022-07-15 15:56:24 +00:00
Leonid Fedorov
56b01fdefc Workaround for gtest compile bug 2022-07-11 22:27:25 +02:00
Roman Nozdrin
0907ca414f MCOL-5044 This patch simplifies addJob interfaces removing extra bool that control mutex locking,
adds additional nullptr dereference check in removeJobs and fixes FairThreadPool
hashmap iter invalidation issues
2022-07-09 12:50:30 +00:00
Roman Nozdrin
6cff14997d Revert "This reverts MCOL-5044 AKA FairThreadPool that breaks regr test002"
This reverts commit 61359119ad3e7002c1855fd1bb433f0d2795d1e4.
2022-07-09 12:38:51 +00:00
NTH19
a4842ef998 rename 2022-06-24 16:53:02 +08:00
NTH19
4c0b8fd829 simd of arm neon
unit testing

pass unit test for simdprocessor

add test cases

implement specific _mm_movemask for different types

float movemask change

rename
2022-06-24 11:24:59 +08:00
Leonid Fedorov
3638f4ac8c Replace gtest_discovery_tests with gtests_add_tests
Despite we have another number of tests in result, they all still run
gtests_add_test cannot parse TYPED_TEST_SUITE one by one and run them
in one bunch
2022-06-13 15:05:10 +00:00
Roman Nozdrin
61359119ad This reverts MCOL-5044 AKA FairThreadPool that breaks regr test002
This reverts commit e40c16bd561086e1fc085f0365948b6d44cd8aab, reversing
changes made to 18e6b1d77bdd47877fbb798140b739d19f063cb2.
2022-06-10 14:17:59 +00:00
Roman Nozdrin
fd8ba33f21 MCOL-5044 This patch replaces PriorityThreadPool with FairThreadPool that uses a simple
operations + morsel size weight model to equally allocate CPU b/w parallel query morsels.
This patch delivers better parallel query timings distribution(timings graph resembles normal
distribution with a bigger left side thus more queries runs faster comparing with PrioThreadPool-based
single-node installation).
See changes in batchprimitiveprocessor-jl.h and comments in fair_threadpool.h for
important implementation details
2022-06-03 10:08:12 +00:00
Roman Nozdrin
0f0b3a2bed Disable FairThreadPool unit tests in develop-6 b/c its unit test segfaults in containers 2022-06-02 17:05:30 +00:00
Roman Nozdrin
c92dc08264 MCOL-5044 Initial version of a fair thread pool
PP now uses PriorityThreadPool that arbitrary picks another jobs pack
    to run. This scheduling discipline tend to run portions of a single query
    forcing other simultaneous queries to wait. In result parallel queries
    timings variance is high. The FairThreadPool picks the job with the smallest
    amount of work done so far(see the code for details)
2022-06-02 17:05:12 +00:00
Roman Nozdrin
4c26e4f960 MCOL-4912 This patch introduces Extent Map index to improve EM scaleability
EM scaleability project has two parts: phase1 and phase2.
        This is phase1 that brings EM index to speed up(from O(n) down
        to the speed of boost::unordered_map) EM lookups looking for
        <dbroot, oid, partition> tuple to turn it into LBID,
        e.g. most bulk insertion meta info operations.
        The basis is boost::shared_managed_object where EMIndex is
        stored. Whilst it is not debug-friendly it allows to put a
        nested structs into shmem. EMIndex has 3 tiers. Top down description:
        vector of dbroots, map of oids to partition vectors, partition
        vectors that have EM indices.
        Separate EM methods now queries index before they do EM run.
        EMIndex has a separate shmem file with the fixed id
        MCS-shm-00060001.
2022-05-04 12:59:16 +00:00