1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00
Commit Graph

1162 Commits

Author SHA1 Message Date
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
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
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
ba4156fe13 Merge pull request #1607 from drrtuy/MCOL-4394
MCOL-4394 __float128 related code had been moved into a separate file
2020-11-20 11:50:54 +03:00
820703d2d0 Merge pull request #1568 from dhall-MariaDB/MCOL-4255-dev
MCOL-4255 dev fix ROUND(datecolumn)
2020-11-19 18:19:07 -05:00
1b7fea9a12 MCOL-4255 dev fix ROUND(datecolumn)
The behavior of Server changed
2020-11-19 17:10:40 -06:00
178be69bc4 MCOL-4394 __float128 related code had been moved into a separate file
Trim to double and to long double conversions for Decimal
2020-11-19 12:08:18 +00:00
aa44bca473 A pack of fixes for compilation errors and warnings for all platforms
Add libdatatypes.so into debian packaging
2020-11-19 10:21:45 +00:00
58495d0d2f MCOL-4387 Convert dataconvert::decimalToString() into VDecimal and TSInt128 methods 2020-11-18 13:53:16 +00:00
007b8a5082 MCOL-4188 Fix regressions in CEIL()/CHAR() for narrow decimals.
In addition, a regression in a WHERE clause with a WF field
as the LHS and an addition operation on two WF fields on the RHS
is also fixed. The issue was SimpleColumn::getDecimalVal() was
setting precision = 19, with the value of one of the operands of the
addition operation being set in VDecimal::value instead of
VDecimal::s128Value. addSubtractExecute() in mcs_decimal.cpp makes the
assumption that if precision > 18 and precision <= 38, we need to
fetch the wide s128Value, not the narrow value field. So we are
fixing the precision set in SimpleColumn::getDecimalVal().
2020-11-18 13:53:16 +00:00
6fd7916c56 MCOL-4188 Fix regression in a union subquery involving a numeric field.
Since we now perform type promotion to wide decimals for aggregations
involving numeric fields, we need to check for wide decimal in
in and out ROWs and call the appropriate setter and getter functions.
2020-11-18 13:53:16 +00:00
3d7f5c6fd1 MCOL-4377 Split DataConvert::convertColumnData() 2020-11-18 13:53:16 +00:00
c00daa93bd MCOL-4172 MultiDistinctRowAggregation didn't honor multiple UDAF in projection
::doUDAF() doesn't crash anymore trying to access fRGContextColl[] elements
that doesn't exist running RowAggregationMultiDistinct::doAggregate()
2020-11-18 13:53:15 +00:00
15b1bfa709 Fix fallthrough compilation warnings 2020-11-18 13:53:15 +00:00
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
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
129d5b5a0f MCOL-4174 Review/refactor frontend/connector code 2020-11-18 13:53:15 +00:00
68244ab957 MCOL-641 Fix regression in aggregate distinct on narrow decimal.
The else if block in Row::equals() was incorrectly getting triggered
for narrow decimals earlier. We now specifically check if the column
is a wide decimal. Furthermore, we need to dereference the int128_t
pointers for equality comparison.
2020-11-18 13:52:20 +00:00
844472d812 MCOL-4313 Very fragile but high speed approach with inline ASM
GCC compiler uses aligned versions of SIMD instructions expecting
aligned memory blocks that is hard to implement now
2020-11-18 13:52:20 +00:00
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
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
1c3a34a3d0 Dataconvert::decimalToString badly fails w/o 20th member of mcs_pow_10 so I returned it
WF::percentile runtime threw an exception b/c of wrong DT deduced from its argument

Replaced literals with constants

Tought WF_sum_avg::checkSumLimit to use refs instead of values
2020-11-18 13:52:20 +00:00
af80081c94 MCOL-4171 Some fixes 2020-11-18 13:52:20 +00:00
5b8aba0005 MCOL-4171 use const ref when passing int128
It saves a pico second or two.
2020-11-18 13:52:20 +00:00
2d044fd7f1 MCOL-4171 Fix comments in bytestream.h 2020-11-18 13:52:19 +00:00
c4d8516a47 MCOL-4171 Window functions with decimal(38) 2020-11-18 13:52:19 +00:00
1588ebe439 MCOL-641 Clean up primitives code
Add int128_t support into ByteStream

Fixed UTs broken after collation patch
2020-11-18 13:52:19 +00:00
638202417f MCOL-4171 2020-11-18 13:52:19 +00:00
d3bc68b02f MCOL-641 Refactor initial extent elimination support.
This commit also adds support in TupleHashJoinStep::forwardCPData,
although we currently do not support wide decimals as join keys.

Row estimation to determine large-side of the join is also updated.
2020-11-18 13:52:19 +00:00
6aea838360 MCOL-641 Add support for functions (Part 2). 2020-11-18 13:51:55 +00:00
bd0d5af123 Merge fixes. 2020-11-18 13:51:26 +00:00
17bad9eb0b MCOL-641 Initial support for ORDER BY on wide DECIMALs. 2020-11-18 13:51:26 +00:00
eeebe83839 MCOL-641 Fixed the incorrect if-condition. 2020-11-18 13:51:26 +00:00
51d77d74df MCOL-641 Fix for GROUP BY on wide-DECIMALs. 2020-11-18 13:51:26 +00:00
a7fcf39f2a MCOL-641 Fixed group_concat for narrow-DECIMALs. 2020-11-18 13:51:26 +00:00
f63611c422 MCOL-641 This commit adds support for group_concat w/o ORDER BY.
Small refactoring in Row methods.
2020-11-18 13:51:26 +00:00
21a41738e1 MCOL-641 Simple aggregates works with GROUP BY column keys.
Fixed constant colump copy for binary columns in TNS.
2020-11-18 13:51:26 +00:00
e88cbe9bc1 MCOL-641 Simple aggregates support: min, max, sum, avg for wide-DECIMALs. 2020-11-18 13:51:25 +00:00
3d94ec1568 MCOL-641 Followup on functions commit. 2020-11-18 13:51:25 +00:00
cfe35b5c7f MCOL-641 Add support for functions (Part 1). 2020-11-18 13:51:25 +00:00
74b64eb4f1 MCOL-641 1. Add support for int128_t in ParsedColumnFilter.
2. Set Decimal precision in SimpleColumn::evaluate().
3. Add support for int128_t in ConstantColumn.
4. Set IDB_Decimal::s128Value in buildDecimalColumn().
5. Use width 16 as first if predicate for branching based on decimal width.
2020-11-18 13:47:45 +00:00
b09f3088ca MCOL-641 Initial version of Math operations for wide decimal. 2020-11-18 13:47:44 +00:00
62d0c82d75 MCOL-641 1. Templatized convertValueNum() function.
2. Allocate int128_t buffers in batchprimitiveprocessor if
a query involves wide decimal columns.
2020-11-18 13:47:44 +00:00
9b714274db MCOL-641 1. Minor refactoring of decimalToString for int128_t.
2. Update unit tests for decimalToString.
3. Allow support for wide decimal in TupleConstantStep::fillInConstants().
2020-11-18 13:47:44 +00:00
2e8e7d52c3 Renamed datatypes/decimal.* into csdecimal to avoid collision with MDB. 2020-11-18 13:47:44 +00:00
238386bf63 MCOL-641 Replaced IDB_Decima.__v union with int128_t attribute.
Moved all tests into ./test

Introduced ./datatypes directory
2020-11-18 13:47:44 +00:00
824615a55b MCOL-641 Refactor empty value implementation in writeengine. 2020-11-18 13:47:44 +00:00
97ee1609b2 MCOL-641 Replaced NULL binary constants.
DataConvert::decimalToString, toString, writeIntPart, writeFractionalPart are not templates anymore.
2020-11-18 13:47:44 +00:00
61647c1f5b MCOL-641 DataConvert::decimalToString() refactoring. 2020-11-18 13:47:02 +00:00
8f80c1dee6 MCOL-641 1. Implement int128 version of strtoll.
2. Templatize number_int_value.
3. Add test cases for strtoll128 and number_int_value for Decimal38.
2020-11-18 13:47:02 +00:00