mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 18:50:49 +00:00
ADQM-34 fix hardcode for,at name in ArrowColumnToCHColumn class
This commit is contained in:
parent
caf0d30a5f
commit
321233ddaa
@ -268,7 +268,7 @@ namespace DB
|
|||||||
|
|
||||||
void ArrowColumnToCHColumn::arrowTableToCHChunk(Chunk &res, std::shared_ptr<arrow::Table> &table,
|
void ArrowColumnToCHColumn::arrowTableToCHChunk(Chunk &res, std::shared_ptr<arrow::Table> &table,
|
||||||
arrow::Status &read_status, const Block &header,
|
arrow::Status &read_status, const Block &header,
|
||||||
int &row_group_current, const Context &context)
|
int &row_group_current, const Context &context, std::string format_name)
|
||||||
{
|
{
|
||||||
Columns columns_list;
|
Columns columns_list;
|
||||||
UInt64 num_rows = 0;
|
UInt64 num_rows = 0;
|
||||||
@ -277,7 +277,7 @@ namespace DB
|
|||||||
|
|
||||||
using NameToColumnPtr = std::unordered_map<std::string, std::shared_ptr<arrow::Column>>;
|
using NameToColumnPtr = std::unordered_map<std::string, std::shared_ptr<arrow::Column>>;
|
||||||
if (!read_status.ok())
|
if (!read_status.ok())
|
||||||
throw Exception{"Error while reading ORC data: " + read_status.ToString(),
|
throw Exception{"Error while reading " + format_name + " data: " + read_status.ToString(),
|
||||||
ErrorCodes::CANNOT_READ_ALL_DATA};
|
ErrorCodes::CANNOT_READ_ALL_DATA};
|
||||||
|
|
||||||
if (0 == table->num_rows())
|
if (0 == table->num_rows())
|
||||||
@ -333,7 +333,7 @@ namespace DB
|
|||||||
throw Exception
|
throw Exception
|
||||||
{
|
{
|
||||||
"The type \"" + arrow_column->type()->name() + "\" of an input column \"" + arrow_column->name()
|
"The type \"" + arrow_column->type()->name() + "\" of an input column \"" + arrow_column->name()
|
||||||
+ "\" is not supported for conversion from a ORC data format",
|
+ "\" is not supported for conversion from a " + format_name + " data format",
|
||||||
ErrorCodes::CANNOT_CONVERT_TYPE};
|
ErrorCodes::CANNOT_CONVERT_TYPE};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ namespace DB
|
|||||||
default:
|
default:
|
||||||
throw Exception
|
throw Exception
|
||||||
{
|
{
|
||||||
"Unsupported ORC type \"" + arrow_column->type()->name() + "\" of an input column \""
|
"Unsupported " + format_name + " type \"" + arrow_column->type()->name() + "\" of an input column \""
|
||||||
+ arrow_column->name() + "\"",
|
+ arrow_column->name() + "\"",
|
||||||
ErrorCodes::UNKNOWN_TYPE
|
ErrorCodes::UNKNOWN_TYPE
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,7 @@ namespace DB
|
|||||||
|
|
||||||
static void arrowTableToCHChunk(Chunk &res, std::shared_ptr<arrow::Table> &table,
|
static void arrowTableToCHChunk(Chunk &res, std::shared_ptr<arrow::Table> &table,
|
||||||
arrow::Status &read_status, const Block &header,
|
arrow::Status &read_status, const Block &header,
|
||||||
int &row_group_current, const Context &context);
|
int &row_group_current, const Context &context, std::string format_name);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -57,7 +57,7 @@ namespace DB
|
|||||||
|
|
||||||
arrow::Status read_status = file_reader->Read(&table);
|
arrow::Status read_status = file_reader->Read(&table);
|
||||||
|
|
||||||
ArrowColumnToCHColumn::arrowTableToCHChunk(res, table, read_status, header, row_group_current, context);
|
ArrowColumnToCHColumn::arrowTableToCHChunk(res, table, read_status, header, row_group_current, context, "ORC");
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ namespace DB
|
|||||||
std::shared_ptr<arrow::Table> table;
|
std::shared_ptr<arrow::Table> table;
|
||||||
arrow::Status read_status = file_reader->ReadRowGroup(row_group_current, &table);
|
arrow::Status read_status = file_reader->ReadRowGroup(row_group_current, &table);
|
||||||
|
|
||||||
ArrowColumnToCHColumn::arrowTableToCHChunk(res, table, read_status, header, row_group_current, context);
|
ArrowColumnToCHColumn::arrowTableToCHChunk(res, table, read_status, header, row_group_current, context, "Parquet");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user