1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

MCOL-4177 Add support for bulk insertion for wide decimals.

1. This patch adds support for wide decimals with/without scale
     to cpimport. In addition, INSERT ... SELECT and LDI are also
     now supported.
  2. Logic to compute the number of bytes to convert a binary
     representation in the buffer to a narrow decimal is also
     simplified.
This commit is contained in:
Gagan Goel
2020-12-11 14:44:28 -05:00
parent 9c623a5434
commit f6b55c1e18
9 changed files with 205 additions and 299 deletions

View File

@@ -1087,13 +1087,21 @@ void XMLJob::fillInXMLDataNotNullDefault(
case execplan::CalpontSystemCatalog::DECIMAL:
case execplan::CalpontSystemCatalog::UDECIMAL:
{
col.fDefaultInt = Convertor::convertDecimalString(
col_defaultValue.c_str(),
col_defaultValue.length(),
colType.scale);
if (LIKELY(colType.colWidth == datatypes::MAXDECIMALWIDTH))
{
col.fDefaultWideDecimal = colType.decimal128FromString(
col_defaultValue, &bDefaultConvertError);
}
else
{
col.fDefaultInt = Convertor::convertDecimalString(
col_defaultValue.c_str(),
col_defaultValue.length(),
colType.scale);
if (errno == ERANGE)
bDefaultConvertError = true;
if (errno == ERANGE)
bDefaultConvertError = true;
}
break;
}