File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 1515// specific language governing permissions and limitations
1616// under the License.
1717
18- use arrow:: {
19- array:: { ArrayRef , AsArray , Int64Array } ,
20- error:: ArrowError ,
21- } ;
18+ use arrow:: array:: { ArrayRef , AsArray , Int64Array } ;
2219use std:: any:: Any ;
2320use std:: sync:: Arc ;
2421
@@ -114,7 +111,7 @@ const FACTORIALS: [i64; 21] = [
114111 6402373705728000 ,
115112 121645100408832000 ,
116113 2432902008176640000 ,
117- ] ;
114+ ] ; // if return type changes, this constant needs to be updated accordingly
118115
119116/// Factorial SQL function
120117fn factorial ( args : & [ ArrayRef ] ) -> Result < ArrayRef > {
@@ -127,9 +124,7 @@ fn factorial(args: &[ArrayRef]) -> Result<ArrayRef> {
127124 } else if a < FACTORIALS . len ( ) as i64 {
128125 Ok ( FACTORIALS [ a as usize ] )
129126 } else {
130- Err ( ArrowError :: ComputeError ( format ! (
131- "Overflow happened on FACTORIAL({a})"
132- ) ) )
127+ exec_err ! ( "Overflow happened on FACTORIAL({a})" )
133128 }
134129 } ) ?;
135130 Ok ( Arc :: new ( result) as ArrayRef )
Original file line number Diff line number Diff line change @@ -795,7 +795,7 @@ select
79579539 Decimal128(2, 1)
796796
797797# factorial overflow
798- query error DataFusion error: Arrow error: Compute error: Overflow happened on FACTORIAL\(350943270\)
798+ query error DataFusion error: Execution error: Overflow happened on FACTORIAL\(350943270\)
799799select FACTORIAL(350943270);
800800
801801statement ok
You can’t perform that action at this time.
0 commit comments