如何在Databricks中为SQL Warehouse设置默认时区?

huangapple go评论58阅读模式
英文:

How to set default time zone for SQL Warehouse in Databricks?

问题

我想要在Databricks的SQL Persona中更改SQL Warehouse的默认时区。

当我尝试编辑“SQL Warehouses”部分中的SQL warehouse设置时,我无法找到任何可以设置时区的选项。

我知道可以通过在查询编辑器中运行查询“SET TIME ZONE 'GMT+10';”来设置时区。但是,我需要每次启动SQL Warehouse时运行此命令。

我不想每次在查询编辑器中运行查询时都重复上述命令。相反,我想将本地时区设置为SQL Warehouse的默认时区。

有没有办法实现这一点?

英文:

I want to change the default time zone for SQL Warehoue in the SQL Persona, in Databricks.

When I try to Edit the SQL warehouse settings in the "SQL Warehouses" section, I am not able to find any setting where I can set the time zone.

I am aware that I can set the time zone by running the query "SET TIME ZONE 'GMT+10';" in the query editor. But, I need to run this command every time I start the SQL warehouse.

I don't want to repeat the above command every time I run a query in the query editor. Instead, I want to set the local time zone as the default time zone of the SQL warehouse.

Any idea how to do that?

答案1

得分: 2

系统默认为UTC

TIMEZONE配置参数控制会话内时间戳操作所使用的本地时区。

您可以使用SET语句在会话级别设置此参数,并且可以使用SQL配置参数SQL Warehouse API在全局级别设置它。

另一种设置会话时区的方法是使用SET TIME ZONE语句

英文:

> The system default is `UTC.

The TIMEZONE configuration parameter controls the local timezone used for timestamp operations within a session.

You can set this parameter at the session level using the SET statement and at the global level using SQL configuration parameters or the SQL Warehouse API.

An alternative way to set the session timezone is using the SET TIME ZONE statement.

huangapple
  • 本文由 发表于 2023年6月15日 12:55:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76479236.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定