Merge pull request #68696 from ucasfl/minor

Use proper ErrorCodes, replace NETWORK_ERROR by HDFS_ERROR
This commit is contained in:
Kseniia Sumarokova 2024-09-17 10:57:30 +00:00 committed by GitHub
commit 64106e7b3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,12 +22,12 @@ namespace DB
namespace ErrorCodes
{
extern const int NETWORK_ERROR;
extern const int CANNOT_OPEN_FILE;
extern const int CANNOT_SEEK_THROUGH_FILE;
extern const int SEEK_POSITION_OUT_OF_BOUND;
extern const int LOGICAL_ERROR;
extern const int UNKNOWN_FILE_SIZE;
extern const int HDFS_ERROR;
extern const int CANNOT_OPEN_FILE;
extern const int CANNOT_SEEK_THROUGH_FILE;
extern const int SEEK_POSITION_OUT_OF_BOUND;
extern const int LOGICAL_ERROR;
extern const int UNKNOWN_FILE_SIZE;
}
@ -125,9 +125,12 @@ struct ReadBufferFromHDFS::ReadBufferFromHDFSImpl : public BufferWithOwnMemory<S
if (bytes_read < 0)
{
throw Exception(ErrorCodes::NETWORK_ERROR,
throw Exception(
ErrorCodes::HDFS_ERROR,
"Fail to read from HDFS: {}, file path: {}. Error: {}",
hdfs_uri, hdfs_file_path, std::string(hdfsGetLastError()));
hdfs_uri,
hdfs_file_path,
std::string(hdfsGetLastError()));
}
if (bytes_read)