Skip to content

Commit 70ed548

Browse files
committed
fix: Try return type null
1 parent b81ebf6 commit 70ed548

File tree

1 file changed

+3
-15
lines changed
  • datafusion/functions/src/datetime

1 file changed

+3
-15
lines changed

datafusion/functions/src/datetime/now.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use arrow::datatypes::DataType::Timestamp;
19-
use arrow::datatypes::TimeUnit::Nanosecond;
20-
use arrow::datatypes::{DataType, Field, FieldRef};
18+
use arrow::datatypes::DataType;
2119
use std::any::Any;
2220

2321
use datafusion_common::{internal_err, Result, ScalarValue};
2422
use datafusion_expr::simplify::{ExprSimplifyResult, SimplifyInfo};
2523
use datafusion_expr::{
26-
ColumnarValue, Documentation, Expr, ReturnFieldArgs, ScalarUDFImpl, Signature,
27-
Volatility,
24+
ColumnarValue, Documentation, Expr, ScalarUDFImpl, Signature, Volatility,
2825
};
2926
use datafusion_macros::user_doc;
3027

@@ -77,17 +74,8 @@ impl ScalarUDFImpl for NowFunc {
7774
&self.signature
7875
}
7976

80-
fn return_field_from_args(&self, _args: ReturnFieldArgs) -> Result<FieldRef> {
81-
Ok(Field::new(
82-
self.name(),
83-
Timestamp(Nanosecond, Some("+00".into())),
84-
false,
85-
)
86-
.into())
87-
}
88-
8977
fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType> {
90-
internal_err!("return_field_from_args should be called instead")
78+
Ok(DataType::Null)
9179
}
9280

9381
fn invoke_with_args(

0 commit comments

Comments
 (0)