Skip to content

Commit 04c8611

Browse files
committed
fixup! Migrate ToUnixtimeFunc to implement invoke_batch
1 parent b3d8d15 commit 04c8611

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

datafusion/functions/src/datetime/to_unixtime.rs

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

18-
use arrow::datatypes::{DataType, TimeUnit};
19-
use std::any::Any;
20-
use std::sync::OnceLock;
21-
use criterion::BatchSize;
2218
use super::to_timestamp::ToTimestampSecondsFunc;
2319
use crate::datetime::common::*;
20+
use arrow::datatypes::{DataType, TimeUnit};
21+
use criterion::BatchSize;
2422
use datafusion_common::{exec_err, Result};
2523
use datafusion_expr::scalar_doc_sections::DOC_SECTION_DATETIME;
2624
use datafusion_expr::{
2725
ColumnarValue, Documentation, ScalarUDFImpl, Signature, Volatility,
2826
};
27+
use std::any::Any;
28+
use std::sync::OnceLock;
2929

3030
#[derive(Debug)]
3131
pub struct ToUnixtimeFunc {
@@ -63,7 +63,11 @@ impl ScalarUDFImpl for ToUnixtimeFunc {
6363
Ok(DataType::Int64)
6464
}
6565

66-
fn invoke_batch(&self, args: &[ColumnarValue], batch_size: usize) -> Result<ColumnarValue> {
66+
fn invoke_batch(
67+
&self,
68+
args: &[ColumnarValue],
69+
batch_size: usize,
70+
) -> Result<ColumnarValue> {
6771
if args.is_empty() {
6872
return exec_err!("to_unixtime function requires 1 or more arguments, got 0");
6973
}

0 commit comments

Comments
 (0)