Parquet input: change if to switch

This commit is contained in:
Ivan Zhukov 2018-05-17 03:10:20 +03:00
parent 4076ae77b4
commit 31e27effa6

View File

@ -199,32 +199,29 @@ Block ParquetBlockInputStream::readImpl()
// TODO: support NULL values // TODO: support NULL values
if (arrow::Type::STRING == arrow_type) switch (arrow_type)
{ {
fillColumnWithStringData(arrow_column, read_column); case arrow::Type::STRING:
} fillColumnWithStringData(arrow_column, read_column);
else if (arrow::Type::BOOL == arrow_type) break;
{ case arrow::Type::BOOL:
fillColumnWithBooleanData(arrow_column, read_column); fillColumnWithBooleanData(arrow_column, read_column);
} break;
// TODO: check that values smaller than INT32 are being read correctly // TODO: check that values smaller than INT32 are being read correctly
#define DISPATCH(ARROW_NUMERIC_TYPE, CPP_NUMERIC_TYPE) \ #define DISPATCH(ARROW_NUMERIC_TYPE, CPP_NUMERIC_TYPE) \
else if (ARROW_NUMERIC_TYPE == arrow_type) \ case ARROW_NUMERIC_TYPE: \
{ \ fillColumnWithNumericData<CPP_NUMERIC_TYPE>(arrow_column, read_column); \
fillColumnWithNumericData<CPP_NUMERIC_TYPE>(arrow_column, read_column); \ break;
}
FOR_ARROW_NUMERIC_TYPES(DISPATCH) FOR_ARROW_NUMERIC_TYPES(DISPATCH)
#undef DISPATCH #undef DISPATCH
// TODO: arrow::Type::DATE32
// TODO: arrow::Type::DATE64
// TODO: arrow::Type::BOOLEAN // TODO: add other types
// TODO: arrow::Type::DATE32 default:
// TODO: arrow::Type::DATE64 throw Exception("Unsupported parquet type " + arrow_column->type()->name()/*, ErrorCodes::TODO*/);
// TODO: add other types
else
{
throw Exception("Unsupported parquet type " + arrow_column->type()->name()/*, ErrorCodes::TODO*/);
} }
column.column = std::move(read_column); column.column = std::move(read_column);