Databricks Sql:替代 NCHAR() 来替换字符

Databricks Sql: Alternative to NCHAR() to replace characters

我的 table 中有些名字需要用其他字符替换。 我有以下代码,但出现错误

REPLACE(REPLACE(TRIM(name),NCHAR(0x2019),NCHAR(0x0027)),NCHAR(0x200B),'')

但是我收到以下错误消息。有人可以帮我重写不使用 Nchar 函数的代码吗?

Undefined function: 'NCHAR'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'

您可以使用 unicode 文字 (\uXXXX) 代替 NCHAR 函数来表示 Spark documentation 中描述的字符,在您的情况下它将是:

REPLACE(REPLACE(TRIM(name),'\u2019','\u0027'),'\u200B','')