Skip to content

Commit b59bf4b

Browse files
committed
incorporate feedback
1 parent eb185ba commit b59bf4b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/errors/arrow_error.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct ArrowErrorProto {
77
pub ctx: Option<String>,
88
#[prost(
99
oneof = "ArrowErrorInnerProto",
10-
tags = "2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19"
10+
tags = "2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20"
1111
)]
1212
pub inner: Option<ArrowErrorInnerProto>,
1313
}
@@ -50,6 +50,8 @@ pub enum ArrowErrorInnerProto {
5050
DictionaryKeyOverflowError(bool),
5151
#[prost(bool, tag = "19")]
5252
RunEndIndexOverflowError(bool),
53+
#[prost(uint64, tag = "20")]
54+
OffsetOverflowError(u64),
5355
}
5456

5557
impl ArrowErrorProto {
@@ -130,9 +132,7 @@ impl ArrowErrorProto {
130132
ctx: ctx.cloned(),
131133
},
132134
ArrowError::OffsetOverflowError(offset) => ArrowErrorProto {
133-
inner: Some(ArrowErrorInnerProto::ParseError(format!(
134-
"Offset overflow error: {offset}"
135-
))),
135+
inner: Some(ArrowErrorInnerProto::OffsetOverflowError(*offset as u64)),
136136
ctx: ctx.cloned(),
137137
},
138138
}
@@ -181,6 +181,9 @@ impl ArrowErrorProto {
181181
ArrowErrorInnerProto::RunEndIndexOverflowError(_) => {
182182
ArrowError::RunEndIndexOverflowError
183183
}
184+
ArrowErrorInnerProto::OffsetOverflowError(offset) => {
185+
ArrowError::OffsetOverflowError(*offset as usize)
186+
}
184187
};
185188
(err, self.ctx.clone())
186189
}
@@ -219,6 +222,7 @@ mod tests {
219222
ArrowError::CDataInterface("cdata error".to_string()),
220223
ArrowError::DictionaryKeyOverflowError,
221224
ArrowError::RunEndIndexOverflowError,
225+
ArrowError::OffsetOverflowError(12345),
222226
];
223227

224228
for original_error in test_cases {

src/protobuf/distributed_codec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ impl PhysicalExtensionCodec for DistributedCodec {
4949
));
5050
};
5151

52+
// TODO: The PhysicalExtensionCodec trait doesn't provide access to session state,
53+
// so we create a new SessionContext which loses any custom UDFs, UDAFs, and other
54+
// user configurations. This is a limitation of the current trait design.
5255
let ctx = SessionContext::new();
5356

5457
match distributed_exec_node {

0 commit comments

Comments
 (0)