Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix orc reader assert on create data_type #8174

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions cpp/src/io/orc/reader_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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<int32_t>(_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<int32_t>(_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;
Expand Down