Redshift Query Syntax error (using SQL Workbench): 有没有简单的方法可以直接转到错误中提到的"position"?

Redshift Query Syntax error (using SQL Workbench): Is there an easy way to go directly to the "position" mentioned in the error?

有没有一种简单的方法可以直接转到SQL Workbench/Redshift中错误消息中提到的位置(错误在代码下方提供)?谢谢!

这是错误:

An error occurred when executing the SQL command:

select application_id, case when stage_name in ( 'Application Review', 'New Lead', 'Recruiter Review', 'Reached Out', ...

Amazon Invalid operation: syntax error at or near ")" Position: 201; [SQL State=42601, DB Errorcode=500310] 1 statement failed.

Execution time: 0.16s

查询如下:

    select
    application_id,
    case when stage_name in (
      'Application Review',
      'New Lead',
      'Recruiter Review',
      'Reached Out',
      'Make Decision',
      'Resume Review',
    ) then 'Application Review' 
    when stage_name in ('Preliminary Phone Screen', 'Recruiter Screen','Handoff','Researcher Screen','Exploratory') then 'Recruiter Screen' 
    when stage_name in (
      'Phone Interview',
      'Phone Interview 2'
      'Phone Interview #1',
      'Phone Interview #2',
      'Phone/Initial Interview #1',
      'Phone/Initial Interview #2',
      'Hiring Manager Review',
      'Hiring Manager Screen',
      'Final Interview',
      'Take Home Test',
      'Initial Interview') 
      then 'Initial Interview' 
    when stage_name in 
    ( 'Onsite Interview #1',
      'Face to Face',
      'Face to Face 2',
      'Onsite Interview #2',
      'Onsite Interview') 
      then 'Onsite Interview' 
    when stage_name = 'Homework' then 'Homework' when stage_name in 
    ( 'Post Onsite',
      'Reference Check',
      'Hiring Review',
      'Hiring Review Debrief',
      'Hiring Review/Debrief',
      'Post Hiring Review / Debrief',
      'Post Hiring Review/Post Debrief',
      'Hiring Review / Debrief',
      'Post Hiring Review / Post Debrief',
      'Team Match') 
      then 'Post Onsite' 
    when stage_name = 'Byteboard Interview' then 'Byteboard Interview' 
    when stage_name IN ('Filtered','Filtered.ai Matching') then 'Filtered' 
    when stage_name = 'HackerRank Test' then 'HackerRank Test' 
    when stage_name = 'ClassMarker' then 'ClassMarker'
when stage_name = 'Offer' then 'Offer' 
else 'Other' end as app_Stage_Name_group,
    min(entered_on) as entered_on,
    max(exited_on) as exited_on
  from
    application_stages
  where
    entered_on is not null
  group by
    1,
    2

如果您使用的是 Build 125,您可以通过 workbench.settings 配置它,使用与 Postgres 相同的设置来识别错误位置。

使用常规文本编辑器编辑文件并添加这两行:

workbench.db.redshift.errorinfo.regex.position=(?i)position:\s+[0-9]+
workbench.db.redshift.errorinfo.leading.comment.included=true

然后光标应该会自动跳转到编辑器中错误消息所标识的位置。

设置文件位于 configuration directory。确切位置显示在关于对话框和选项对话框中。

确保在编辑文件之前关闭 SQL Workbench/J。