1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-07 19:22:02 +03:00

145 Commits

Author SHA1 Message Date
Leonid Fedorov
0984e35709 configcpp refactored 2025-05-30 03:27:04 +00:00
Leonid Fedorov
6db2dc668f stubs and cmake formatting 2025-05-20 18:22:59 +04:00
Leonid Fedorov
2036e521c7 named linkage 2025-05-20 18:22:59 +04:00
drrtuy
e9973c46e4 feat(TNS): change ORDER BY out-of-memory error message. Replaced bad_alloc with IDBExcept in TNS. 2025-05-20 18:22:16 +04:00
Leonid Fedorov
a0bee173f6 chore(build): fixes to satisfy clang19 warnings 2025-05-15 19:05:38 +04:00
drrtuy
d4fe2e7a45 chore(): re-enabled memory accounting for RGData generated by PP::execute() 2025-05-02 10:11:40 +01:00
drrtuy
42417764d8 chore(): cleanup. 2025-05-02 10:11:40 +01:00
drrtuy
01cc73d416 fix(perf,allocator): test build with reduced CountingAllocator parameter values. 2025-05-02 10:11:40 +01:00
=
671b7301f3 fix(allocator,perf): performance degradation caused by lack of STLPoolAllocator replaced by CountingAllocator 2025-05-02 10:11:40 +01:00
Aleksei Antipovskii
4bea7e59a0 feat(PrimProc): MCOL-5852 disk-based GROUP_CONCAT & JSON_ARRAYAGG
* move GROUP_CONCAT/JSON_ARRAYAGG storage to the RowGroup from
  the RowAggregation*
* internal data structures (de)serialization
* get rid of a specialized classes for processing JSON_ARRAYAGG
* move the memory accounting to disk-based aggregation classes
* allow aggregation generations to be used for queries with
  GROUP_CONCAT/JSON_ARRAYAGG
* Remove the thread id from the error message as it interferes with the mtr
2025-04-11 15:21:07 +02:00
drrtuy
b649af5a0c chore(): merge cleanup 2025-03-27 22:12:48 +00:00
drrtuy
09926b3157 feat(TNS, sorting, distinct): TNS now accounts data used by RGDatas and distinct maps. 2025-03-27 22:12:48 +00:00
drrtuy
c6dabe7eb5 feat(TNS): distribute SortingPQ that supports CountingAllocator 2025-03-27 22:12:48 +00:00
drrtuy
0bfe10a7d0 feat(): use CountingAllocator for DISTINCT 2025-03-27 22:12:48 +00:00
Aleksei Antipovskii
0ab03c7258 chore(codestyle): mark virtual methods as override 2025-02-21 20:01:34 +04:00
drrtuy
dc03621e9d 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.
2024-11-08 16:28:51 +04:00
Leonid Fedorov
a508b86091 remove boost/shared_array include 2023-04-14 09:42:50 +00: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
Leonid Fedorov
56f2346083 Remove windows ifdefs 2023-03-02 15:59:42 +00:00
Leonid Fedorov
d2432f9bf6 get rid of pointers for 128 fields 2022-08-26 15:12:22 +00:00
mariadb-AndreyPiskunov
0863ecd279 Replace getBinaryField 2022-08-25 18:21:43 +03:00
Leonid Fedorov
8ff4192f52 get rid of getbinaryfield in ranking window functions 2022-08-24 14:50:03 +00:00
David.Hall
272246e9fa
Merge branch 'develop' into MCOL-4841 2022-06-09 16:58:33 -05:00
david.hall
3b6449842f Merge branch 'develop' into MCOL-4841
# Conflicts:
#	exemgr/main.cpp
#	oam/etc/Columnstore.xml.singleserver
#	primitives/primproc/primproc.cpp
2022-06-09 10:07:26 -05: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
Serguey Zefirov
0dab97da7d Actual fix for percentile window function
We fix 'partial out-of-bounds reference' warning uncovered when building
with gcc11.
2022-05-19 15:48:23 +03:00
Leonid Fedorov
3919c541ac
New warnfixes (#2254)
* Fix clang warnings

* Remove vim tab guides

* initialize variables

* 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length

* Fix ISO C++17 does not allow 'register' storage class specifier for outdated bison

* chars are unsigned on ARM, having  if (ival < 0) always false

* chars are unsigned by default on ARM and comparison with -1 if always true
2022-02-17 13:08:58 +03:00
David Hall
27dea733c5 MCOL4841 dev port run large join without OOM 2022-02-09 17:33:55 -06:00
Leonid Fedorov
04752ec546 clang format apply 2022-01-21 16:43:49 +00:00
Leonid Fedorov
01f3ceb437 replace header guards with #pragma once 2022-01-21 15:24:58 +00:00
Leonid Fedorov
5c5f103f98
MCOL-4839: Fix clang build (#2100)
* Fix clang build

* Extern C returned to plugin_instance

Co-authored-by: Leonid Fedorov <l.fedorov@mail.corp.ru>
2021-08-23 10:45:10 -05:00
Leonid Fedorov
dbb1269d69
GetInterrupted returned bool instead of bool * (#2085) 2021-08-18 11:50:45 -05:00
Alexander Barkov
9794f24369 MCOL-4801 Replace Row methods getStringLength() and getStringPointer() to getConstString() 2021-07-06 21:15:32 +04:00
Alexander Barkov
9608533d92 MCOL-4734 Compilation failure: MariaDB-10.6 + ColumnStore-develop
mcsconfig.h and my_config.h have the following
pre-processor definitions:

1. Conflicting definitions coming from the standard cmake definitions:
- PACKAGE
- PACKAGE_BUGREPORT
- PACKAGE_NAME
- PACKAGE_STRING
- PACKAGE_TARNAME
- PACKAGE_VERSION
- VERSION

2. Conflicting definitions of other kinds:
- HAVE_STRTOLL - this is a dirt in MariaDB headers.
  Should be fixed in the server code. my_config.h erroneously
  performs "#define HAVE_STRTOLL" instead of "#define HAVE_STRTOLL 1".
  in some cases. The former is not CMake compatible style. The latter is.

3. Non-conflicting definitions:
  Otherwise, mcsconfig.h and my_config.h should be mutually compatible,
  because both are generated by cmake on the same host machine. So
  they should have exactly equal definitions like "HAVE_XXX", "SIZEOF_XXX", etc.

Observations:
- It's OK to include both mcsconfig.h and my_config.h providing that we
  suppress duplicate definition of the above conflicting types #1 and #2.
- There is no a need to suppress duplicate definitions mentioned in #3,
  as they are compatible!
- my_sys.h and m_ctype.h must always follow a CMake configuation header,
  either my_config.h or mcsconfig.h (or both).
  They must never be included without any preceeding configuration header.

This change make sure that we resolve conflicts by:
- either disallowing inclusion of mcsconfig.h and my_config.h
  at the same time
- or by hiding conflicting definitions #1 and #2
  (with their later restoring).
- also, by making sure that my_sys.h and m_ctype.h always follow
  a CMake configuration file.

Details:
- idb_mysql.h can now only be included only after my_config.h
  An attempt to use idb_mysql.h with mcsconfig.h instead of
  my_config.h is caught by the "#error" preprocessor directive.

- mariadb_my_sys.h can now be only included after mcsconfig.h.
  An attempt to use mariadb_my_sys.h without mcscofig.h
  (e.g. with my_config.h) is also caught by "#error".

- collation.h now can now be included in two ways.
  It now has the following effective structure:

    #if defined(PREFER_MY_CONFIG_H) && defined(MY_CONFIG_H)
    //  Remember current conflicting definitions on the preprocessor stack
    //  Undefine current conflicting definitions
    #endif
    #include "mcsconfig.h"
    #include "m_ctype.h"
    #if defined(PREFER_MY_CONFIG_H) && defined(MY_CONFIG_H)
    #    Restore conflicting definitions from the preprocessor stack
    #endif

  and can be included as follows:

  a. using only mcsconfig.h as a configuration header:

    // my_config.h must not be included so far
    #include "collation.h"

  b. using my_config.h as the first included configuration file:

    #define PREFER_MY_CONFIG_H // Force conflict resolution
    #include "my_config.h"     // can be included directly or indirectly
    ...
    #include "collation.h"

Other changes:

- Adding helper header files
     utils/common/mcsconfig_conflicting_defs_remember.h
     utils/common/mcsconfig_conflicting_defs_restore.h
     utils/common/mcsconfig_conflicting_defs_undef.h
  to perform conflict resolution easier.

- Removing `#include "collation.h"` from a number of files,
  as it's automatically included from rowgroup.h.

- Removing redundant `#include "utils_utf8.h"`.
  This change is not directly related to the problem being fixed,
  but it's nice to remove redundant directives for both collation.h
  and utils_utf8.h from all the files that do not really need them.
  (this change could probably have gone as a separate commit)

- Changing my_init() to MY_INIT(argv[0]) in the MCS services sources.
  After the fix of the complitation failure it appeared that ColumnStore
  services compiled with the debug build crash due to recent changes in
  safemalloc. The crash happened in strcmp() with `my_progname` as an argument
  (where my_progname is a mysys global variable). This problem should
  probably be fixed on the server side as well to avoid passing NULL.
  But, the majority of MariaDB executable programs also use MY_INIT(argv[0])
  rather than my_init(). So let's make MCS do like the other programs do.
2021-05-25 12:34:36 +04:00
Alexander Barkov
362bfcd15e MCOL-4361 Replace pow(10.0, (double)scale) expressions with a static dictionary lookup. 2021-04-09 12:41:04 +04:00
Alexey Antipovsky
5080e1ae53 MCOL-4031 More accurate memory usage counting while sorting 2021-01-29 18:31:20 +03:00
Alexander Barkov
09f937693f MCOL-4454 "ORDER BY BINARY a" is not like in InnoDB 2021-01-12 12:33:44 +04:00
Roman Nozdrin
dd8289d4fd
Merge pull request #1619 from tntnatbry/MCOL-4188-bps-wf-fix
MCOL-4188 Regression fixes for MCOL-641.
2020-12-04 08:16:34 +03:00
Gagan Goel
785bc43435 MCOL-4188 Regression fixes for MCOL-641.
1. Make PredicateOperator::setOpType() function wide decimal aware.
  2. Added support for wide decimal in jlf_subquery.cpp::getColumnValue()
     used in scalar subqueries.
  3. Fixed the column index used for fetching wide decimal values from a Row
     when a wide decimal field is used in the order by clause.
2020-11-27 13:27:48 -05:00
Gagan Goel
9c18771b61 MCOL-4188 Regression fixes for MCOL-641.
1. In BatchPrimitiveProcessorJL::countThisMsg(), exit early if the
return code from primproc is non-zero.
2. For statistical window functions (stddev/var), properly handle
the case when there is only one value for the calculation.
2020-11-27 03:04:30 +00:00
Roman Nozdrin
454ec4be99
Merge pull request #1613 from tntnatbry/MCOL-641-alter-table-fix
MCOL-641 Fix alter table add wide decimal column.
2020-11-26 18:17:01 +03:00
Gagan Goel
c5d4a918ee MCOL-4188 Regression fixes for MCOL-641.
1. In TupleAggregateStep::configDeliveredRowGroup(), use
jobInfo.projectionCols instead of jobInfo.nonConstCols
for setting scale and precision if the source column is
wide decimal.

2. Tighten rules for wide decimal processing. Specifically:
  a. Replace (precision > INT64MAXPRECISION) checks with
     (precision > INT64MAXPRECISION && precision <= INT128MAXPRECISION)
  b. At places where (colWidth == MAXDECIMALWIDTH) is not enough to
     determine if a column is wide decimal or not, also add a check on
     type being DECIMAL/UDECIMAL.
2020-11-24 20:15:33 -05:00
Gagan Goel
995cadef2d MCOL-641 Fix alter table add wide decimal column.
This patch also removes CalpontSystemCatalog::BINARY and
ddlpackage::DDL_BINARY that were added during the initial
stages of the work on MCOL-641.
2020-11-20 19:49:54 -05:00
Roman Nozdrin
15b1bfa709 Fix fallthrough compilation warnings 2020-11-18 13:53:15 +00:00
Roman Nozdrin
3eb26c0d4a MCOL-4313 Introduced TSInt128 that is a storage class for int128
Removed uint128 from joblist/lbidlist.*

Another toString() method for wide-decimal that is EMPTY/NULL aware

Unified decimal processing in WF functions

Fixed a potential issue in EqualCompData::operator() for
    wide-decimal processing

Fixed some signedness warnings
2020-11-18 13:53:15 +00:00
Alexander Barkov
d5c6645ba1 Adding mcs_basic_types.h
For now it consists of only:

using int128_t = __int128;
using uint128_t = unsigned __int128;

All new privitive data types should go into this file in the future.
2020-11-18 13:53:15 +00:00
Alexander Barkov
129d5b5a0f MCOL-4174 Review/refactor frontend/connector code 2020-11-18 13:53:15 +00:00
Roman Nozdrin
8de9764f84 MCOL-4172 Add support for wide-DECIMAL into statistical aggregate and regr_* UDAF functions
The patch fixes wrong results returned when multiple UDAF exist in projection

aggregate over wide decimal literals now works
2020-11-18 13:52:20 +00:00
Roman Nozdrin
f7002e20b5 ::writeRow now treats WR_BINARY as int128 for 16 bytes DT only
WF avg uses const & as arguments types

Removed BINARY from DDL parser
2020-11-18 13:52:20 +00:00