diff --git a/cpp/src/io/orc/reader_impl.cu b/cpp/src/io/orc/reader_impl.cu index e6db8109bf0..ecc36991eee 100644 --- a/cpp/src/io/orc/reader_impl.cu +++ b/cpp/src/io/orc/reader_impl.cu @@ -430,12 +430,15 @@ table_with_metadata reader::impl::read(size_type skip_rows, // Remove this once we support Decimal128 data type CUDF_EXPECTS((col_type != type_id::DECIMAL64) or (_metadata->ff.types[col].precision <= 18), "Decimal data has precision > 18, Decimal64 data type doesn't support it."); - // sign of the scale is changed since cuDF follows c++ libraries like CNL - // which uses negative scaling, but liborc and other libraries - // follow positive scaling. - auto scale = - (col_type == type_id::DECIMAL64) ? -static_cast(_metadata->ff.types[col].scale) : 0; - column_types.emplace_back(col_type, scale); + if (col_type == type_id::DECIMAL64) { + // sign of the scale is changed since cuDF follows c++ libraries like CNL + // which uses negative scaling, but liborc and other libraries + // follow positive scaling. + auto const scale = -static_cast(_metadata->ff.types[col].scale); + column_types.emplace_back(col_type, scale); + } else { + column_types.emplace_back(col_type); + } // Map each ORC column to its column orc_col_map[col] = column_types.size() - 1;