Skip to content

Commit 80cd30c

Browse files
committed
incorporate feedback
1 parent 272000a commit 80cd30c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/protobuf/distributed_codec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ impl PhysicalExtensionCodec for DistributedCodec {
4646
));
4747
};
4848

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

5154
match distributed_exec_node {

src/protobuf/errors/arrow_error.rs

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

5658
impl ArrowErrorProto {
@@ -131,9 +133,7 @@ impl ArrowErrorProto {
131133
ctx: ctx.cloned(),
132134
},
133135
ArrowError::OffsetOverflowError(offset) => ArrowErrorProto {
134-
inner: Some(ArrowErrorInnerProto::ParseError(format!(
135-
"Offset overflow error: {offset}"
136-
))),
136+
inner: Some(ArrowErrorInnerProto::OffsetOverflowError(*offset as u64)),
137137
ctx: ctx.cloned(),
138138
},
139139
}
@@ -182,6 +182,9 @@ impl ArrowErrorProto {
182182
ArrowErrorInnerProto::RunEndIndexOverflowError(_) => {
183183
ArrowError::RunEndIndexOverflowError
184184
}
185+
ArrowErrorInnerProto::OffsetOverflowError(offset) => {
186+
ArrowError::OffsetOverflowError(*offset as usize)
187+
}
185188
};
186189
(err, self.ctx.clone())
187190
}
@@ -220,6 +223,7 @@ mod tests {
220223
ArrowError::CDataInterface("cdata error".to_string()),
221224
ArrowError::DictionaryKeyOverflowError,
222225
ArrowError::RunEndIndexOverflowError,
226+
ArrowError::OffsetOverflowError(12345),
223227
];
224228

225229
for original_error in test_cases {

0 commit comments

Comments
 (0)