Skip to content

Commit 49db8d1

Browse files
authored
feat: Polish error output for thrift errors (#13412)
Signed-off-by: Xuanwo <[email protected]>
1 parent 18d115e commit 49db8d1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/query/storages/hive/hive/src/hive_catalog.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,13 @@ impl HiveCatalog {
143143
pub fn get_client(&self) -> Result<impl TThriftHiveMetastoreSyncClient> {
144144
let mut c = TTcpChannel::new();
145145
c.open(self.client_address.as_str())
146-
.map_err(from_thrift_error)?;
146+
.map_err(from_thrift_error)
147+
.map_err(|err| {
148+
err.add_message_back(format!(
149+
"hive_metadatastore_address: {}",
150+
self.client_address.as_str()
151+
))
152+
})?;
147153
let (i_chan, o_chan) = c.split().map_err(from_thrift_error)?;
148154
let i_tran = TBufferedReadTransport::new(i_chan);
149155
let o_tran = TBufferedWriteTransport::new(o_chan);
@@ -334,7 +340,10 @@ impl HiveCatalog {
334340
}
335341

336342
fn from_thrift_error(error: thrift::Error) -> ErrorCode {
337-
ErrorCode::from_std_error(error)
343+
ErrorCode::Internal(format!(
344+
"thrift error: {:?}, please check your thrift client config",
345+
error
346+
))
338347
}
339348

340349
#[async_trait::async_trait]

0 commit comments

Comments
 (0)