简体   繁体   English

SQL PyCharm 创建大查询表时的样式

[英]SQL PyCharm Style when CREATE Big Query tables

I am modifying the SQL PyCharm Style and I did not find any way to avoid the following transformation when creating Big Query tables:我正在修改 SQL PyCharm 样式,在创建 Big Query 表时我没有找到任何方法来避免以下转换:

CREATE OR REPLACE TABLE `project.dataset.table`

is transformed into:被转化为:

CREATE OR REPLACE TABLE ` project.dataset.table `

With the blank spaces before and after the "`". “`”前后有空格。 Any way to change the SQL style avoiding that?有什么办法可以改变 SQL 的风格来避免这种情况?

I think in SQL it is irrelevant for this situation "`"我认为SQL与这种情况无关“`”

project.dataset.table equally `project.dataset.table` 

or trim functions或修剪功能

CREATE OR REPLACE TABLE  TRIM(` project.dataset.table `)

I'm sorry if I made a mistake:)如果我犯了错误,我很抱歉:)

As a work around this could do the job to remove the spaces:作为解决此问题的方法,可以完成删除空格的工作:

EXECUTE IMMEDIATE("CREATE OR REPLACE TABLE  "|| Replace("` project.dataset.table `"," ","") || " as Select 1 as a")
~~

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM