exasol / cloud-storage-extension

Exasol Cloud Storage Extension for accessing formatted data Avro, Orc and Parquet, on public cloud storage systems
MIT License
7 stars 11 forks source link

Exporting decimal values without trailing zeros #166

Closed morazow closed 3 years ago

morazow commented 3 years ago

Situation

When exporting decimal values without trailing zeros, the scale is shifted.

For example:

EXPORT (select CAST(238316.38 AS DECIMAL(18,4)) as col1)
INTO SCRIPT CLOUD_STORAGE_EXTENSION.EXPORT_PATH WITH
...

the exported value results in 2383.1638 instead of 238316.3800.

This is due to mainly Exasol iterator returns decimal without trailing zeros, and the exporter use the unscaled value and scale when writing Parquet values.

This should be fixed by setting the returned scale after reading decimal values from ExaIterator.

Acceptance Criteria