NGA-TRAN commented on a change in pull request #1030:
URL: https://github.com/apache/arrow-datafusion/pull/1030#discussion_r713038224
##########
File path: datafusion/src/logical_plan/expr.rs
##########
@@ -1408,6 +1452,11 @@ pub fn lit<T: Literal>(n: T) -> Expr {
n.lit()
}
+/// Create a literal timestamp expression
+pub fn lit_timestamp_nanosecond<T: Literal>(n: T) -> Expr {
Review comment:
I think a new trait for appropriate numeric only is a good solution. It
can be extended later to support string parsing. Let me give it a shot.
##########
File path: datafusion/src/logical_plan/expr.rs
##########
@@ -1387,6 +1426,11 @@ macro_rules! make_literal {
fn lit(&self) -> Expr {
Expr::Literal(ScalarValue::$SCALAR(Some(self.clone())))
}
+
+ fn lit_timestamp_nanosecond(&self) -> Expr {
+ let scalar = ScalarValue::$SCALAR(Some(self.clone()));
+ scalar.lit_timestamp_nanosecond()
Review comment:
I have tried that but not all data type works for the `into`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]