Skip to content

Commit 0c7b7be

Browse files
committed
Fix merge errors, return error
1 parent 1af869f commit 0c7b7be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

datafusion/functions/src/core/arrow_cast.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use std::any::Any;
2121
use std::{fmt::Display, iter::Peekable, str::Chars, sync::Arc};
2222

23-
use arrow_schema::{DataType, Field, IntervalUnit, TimeUnit};
23+
use arrow::datatypes::{DataType, Field, IntervalUnit, TimeUnit};
2424
use datafusion_common::{
2525
internal_err, plan_datafusion_err, plan_err, DataFusionError, ExprSchema, Result,
2626
ScalarValue,
@@ -76,8 +76,10 @@ impl ScalarUDFImpl for ArrowCastFunc {
7676
&self.signature
7777
}
7878

79-
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
80-
parse_data_type(&arg_types[1].to_string())
79+
fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType> {
80+
// should be using return_type_from_exprs and not calling the default
81+
// implementation
82+
internal_err!("arrow_cast should return type from exprs")
8183
}
8284

8385
fn return_type_from_exprs(
@@ -693,8 +695,6 @@ impl Display for Token {
693695

694696
#[cfg(test)]
695697
mod test {
696-
use arrow_schema::{IntervalUnit, TimeUnit};
697-
698698
use super::*;
699699

700700
#[test]

0 commit comments

Comments
 (0)