@@ -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
5557impl 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 {
0 commit comments