当前位置:网站首页>13-Set Time Zone
13-Set Time Zone
2022-04-22 19:09:00 【wangyanglongcc】
常用语法
SET TIME ZONE LOCAL
SET TIME ZONE 'timezone_value'
SET TIME ZONE INTERVAL interval_literal
参数解释
- LOCAL
Set the time zone to the one specified in the java user.timezone property, or to the environment variable TZ if user.timezone is undefined, or to the system time zone if both of them are undefined.
- timezone_value
The ID of session local timezone in the format of either region-based zone IDs or zone offsets. Region IDs must have the form ‘area/city’, such as ‘America/Los_Angeles’. Zone offsets must be in the format ‘(+|-)HH’, ‘(+|-)HH:mm’ or ‘(+|-)HH:mm:ss’, e.g ‘-08’, ‘+01:00’ or ‘-13:33:33’. Also, ‘UTC’ and ‘Z’ are supported as aliases of ‘+00:00’. Other short names are not recommended to use because they can be ambiguous.
- interval_literal
The interval literal represents the difference between the session time zone to the ‘UTC’. It must be in the range of [-18, 18] hours and max to second precision, e.g. INTERVAL 2 HOURS 30 MINUTES or INTERVAL '15:40:32' HOUR TO SECOND.
示例
-- Set time zone to the system default.
SET TIME ZONE LOCAL;
-- Set time zone to the region-based zone ID.
SET TIME ZONE 'America/Los_Angeles';
-- Set time zone to the Zone offset.
SET TIME ZONE '+08:00';
-- Set time zone with intervals.
SET TIME ZONE INTERVAL 1 HOUR 30 MINUTES;
SET TIME ZONE INTERVAL '08:30:00' HOUR TO SECOND;
使用
如我们这里使用的是北京/重庆的时区,则可以用以下命令
SET TIME ZONE 'Asia/Shanghai'
SET TIME ZONE '+8:00';
SET TIME ZONE INTERVAL 8 HOUR;
spark.conf.set("spark.sql.session.timeZone", "Asia/Shanghai")
最后用下来发现只有如下语句可用
spark.sql("SET TIME ZONE 'Asia/Shanghai'")
spark.conf.set("spark.sql.session.timeZone", "Asia/Shanghai")
版权声明
本文为[wangyanglongcc]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_33246702/article/details/124341546
边栏推荐
- 【最佳实践】巡检项:内容分发网络(CDN)开启URL鉴权
- [self redemption -- top 101 4-day question brushing plan of niuke.com] warm up exercise on the first day
- 【2022初春】【LeetCode】695. 岛屿的最大面积
- @RequestBody修饰的对象属性大小写映射问题
- yes. Net future
- What is the difference between gb8624-2012 and GB8624-2006?
- Type of Flink window
- 数据库索引
- Huawei cloud media Zha Yong: Huawei cloud's technical practice in the field of video AI transcoding
- Introduction to ribbon of microservice load balancer
猜你喜欢

Alibaba微服务组件Sentinel介绍

webrtc+turn+peerconnection_ Server measurement delay

Bluetooth shield / cervical massage instrument / mini charger / probe thermometer, segment code LCD display driver ic-vk1088b qfn32 4 * 4 ultra small volume, 22seg * 4com, and can enter the power savi

The beautiful and comfortable kn95 mask has strong protection ability

Introduction to feign, a microservice invocation component

Small LED screen / digital alarm clock display screen / LED billboard / temperature digital display and other LED nixie tube display driver ic-vk1640 / 1640B sop28 / ssop24 package

关于字符串常量池,intern方法的理解

Network security -- the use of burp suite packet capture tool

Issues related to redis in Linux system

webrtc+turn+peerconnection_server测延时
随机推荐
HMS Core Discovery第14期回顾长文|纵享丝滑剪辑,释放视频创作力
Introduction to ribbon of microservice load balancer
The beautiful and comfortable kn95 mask has strong protection ability
数据库索引
Misuse of redis cache string
MacOS M1 uses homebrew to install MySQL
【Appium踩坑】Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded
7. Data Center - Data Development: Data System Construction
Introduction notes to PHP zero Foundation (12): array
Customs clearance script
[early spring 2022] [leetcode] 695 Maximum area of the island
防火门可以根据EN 1634-1 标准测试吗?
What does %[^\n] mean in C?
@RequestBody修饰的对象属性大小写映射问题
Take you to understand the principle of highly flexible spark architecture
Introduction to Alibaba micro service component Sentinel
postgre创建序列并绑定到表字段
关于字符串常量池,intern方法的理解
2020-11-04 go test compiled into executable file
Can deleted photos be restored? 3 tips to restore deleted photos