File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
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:: array:: timezone;
1918use arrow:: datatypes:: DataType :: Timestamp ;
2019use arrow:: datatypes:: TimeUnit :: Nanosecond ;
2120use arrow:: datatypes:: { DataType , Field , FieldRef } ;
@@ -81,7 +80,7 @@ impl ScalarUDFImpl for NowFunc {
8180 fn return_field_from_args ( & self , _args : ReturnFieldArgs ) -> Result < FieldRef > {
8281 Ok ( Field :: new (
8382 self . name ( ) ,
84- Timestamp ( Nanosecond , Some ( "+00:00 " . into ( ) ) ) ,
83+ Timestamp ( Nanosecond , Some ( "+00" . into ( ) ) ) ,
8584 false ,
8685 )
8786 . into ( ) )
@@ -113,7 +112,7 @@ impl ScalarUDFImpl for NowFunc {
113112 . config_options
114113 . as_ref ( )
115114 . map ( |opts| opts. execution . time_zone . as_str ( ) )
116- . unwrap_or ( "+00:00 " ) ;
115+ . unwrap_or ( "+00" ) ;
117116
118117 Ok ( ExprSimplifyResult :: Simplified ( Expr :: Literal (
119118 ScalarValue :: TimestampNanosecond ( now_ts, Some ( timezone. into ( ) ) ) ,
Original file line number Diff line number Diff line change 7373##########
7474## Current time Tests
7575##########
76+ statement ok
77+ SET TIME ZONE = '+08'
78+
79+ query T
80+ select arrow_typeof(now());
81+ ----
82+ Timestamp(Nanosecond, Some("+08"))
83+
84+ statement ok
85+ SET TIME ZONE = '+00'
7686
7787query B
7888select cast(now() as time) = current_time();
You can’t perform that action at this time.
0 commit comments