[英]ParseExpection: no viable alternative at input
我試圖在 Azure 數據塊中運行以下查詢。
query=s"""WITH pre_file_user AS(
SELECT id,
typeid,
CASE when dttm is null or dttm='' then cast('1900-01-01 00:00:00.000' as timestamp)
else cast(dttm as timestamp)
end as dttm
from dde_pre_file_user_supp
)"""
spark.sql(query)
然后我收到以下錯誤
ParseException: 在輸入 'with pre_file_users AS (\n select id, \n typid, in case\n 當 dttm 為 null 或 dttm = '' 時沒有可行的替代方案然后 cast('1900-00.00:00:000:01-00: )\n 以 dttm\n 結尾,來自 dde_pre_file_user_supp\n )'
我可以在數據塊中使用 WITH 子句還是有其他選擇?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.