Throw exception when encountering bad Thrift metadata in RecordReader

Change-Id: Id47d6d915700bfa564c647be85864e739db58815
This commit is contained in:
Wes McKinney committed 2018-12-24 16:02:46 -06:00
1 parent cd543b9756
commit 59400a2f14
1 file changed
+6 -2
+6 -2
View File
@@ -850,8 +850,12 @@ std::shared_ptr<RecordReader> RecordReader::Make(const ColumnDescriptor* descr,
case Type::FIXED_LEN_BYTE_ARRAY:
return std::shared_ptr<RecordReader>(
new RecordReader(new TypedRecordReader<FLBAType>(descr, pool)));
default:
DCHECK(false);
default: {
// PARQUET-1481: This can occur if the file is corrupt
std::stringstream ss;
ss << "Invalid physical column type: " << static_cast<int>(descr->physical_type());
throw ParquetException(ss.str());
}
}
// Unreachable code, but supress compiler warning
return nullptr;