MariaDB Columnstore unexplained behaviour using CASE

columnstoremariadb

We were updating column value based on col 'string_hash_id' value, but we couldn't get through:
Error Code: 1815. Internal error: CAL0002: Update Failed: TreeNode::getDecimalVal: non-support conversion from string

sql:

UPDATE table1 JOIN table2 USING(id)
SET table1.calc_col = table_1.col1 * table_1.col2 * table.col3 * ((100 - (
CASE col_id WHEN 'string_hash_id' THEN 2.00 ELSE 1.5 END)) * 0.01)

col1 is signed int, rest of cols are decimal

We thought that if we cast these cols it will work but nothing happens error was the same. But when we changed case values to string it works but it does not make any sense.

THEN 2.00 ELSE 1.5 ==> THEN '2.00' ELSE '1.5'

UPDATE table1 JOIN table2 USING(id)
SET table1.calc_col = table_1.col1 * table_1.col2 * table.col3 * ((100 - (
CASE col_id WHEN 'string_hash_id' THEN '2.00' ELSE '1.5' END)) * 0.01)

And my question is, how is this possible and why it shows TreeNode::getDecimalVal: non-support conversion from string when there is no string.

And works without issues when there is string.

Best Answer

WHEN 'string_hash_id' THEN 

-->

WHEN `string_hash_id` THEN

Apostrophes and double-quotes are for strings; backtics are for column names.

Related Question