不匹配的输入“来自"期望 <EOF>SQL [英] mismatched input 'from' expecting <EOF> SQL
问题描述
我正在 Spark 上运行一个大部分使用 SQL 的进程.在其中一个工作流程中,我收到以下错误:
I am running a process on Spark which uses SQL for the most part. In one of the workflows I am getting the following error:
不匹配的输入 'from' 期待
mismatched input 'from' expecting
代码是
select a.ACCOUNT_IDENTIFIER,a.LAN_CD, a.BEST_CARD_NUMBER,
decision_id,
case when a.BEST_CARD_NUMBER = 1 then 'Y' else 'N' end as best_card_excl_flag
from (select a.ACCOUNT_IDENTIFIER,a.LAN_CD, a. decision_id row_number()
over (partition by CUST_GRP_MBRP_ID
order by coalesce(BEST_CARD_RANK,999)) as BEST_CARD_NUMBER
from Accounts_Inclusions_Exclusions_Flagged a) a
我无法弄清楚我一生中的错误是什么
I cannot figure out what the error is for the life of me
我试过检查逗号错误或意外括号,但这似乎不是问题.
I've tried checking for comma errors or unexpected brackets but that doesn't seem to be the issue.
推荐答案
在你代码的第 4 行,你只需要在 a.decision_id 后面加一个逗号,因为 row_number() 上面是一个单独的列/函数.
In the 4th line of you code, you just need to add a comma after a.decision_id, since row_number() over is a separate column/function.
P.S.:尝试在嵌套的 select 语句中使用缩进,以便您和您的同行可以轻松理解代码.干杯!
P.S.: Try yo use indentation in nested select statements so you and your peers can understand the code easily. Cheers!
这篇关于不匹配的输入“来自"期望 <EOF>SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!