Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Syntax checking is not rigorous. 语法检查不严谨 #41490

Open
3 tasks done
xqg1316 opened this issue Sep 30, 2024 · 0 comments
Open
3 tasks done

[Bug] Syntax checking is not rigorous. 语法检查不严谨 #41490

xqg1316 opened this issue Sep 30, 2024 · 0 comments

Comments

@xqg1316
Copy link

xqg1316 commented Sep 30, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

Doris-2.1.3

What's Wrong?

有一段SQL语句如下:
-- 投资项目评审批复详情
ALTER TABLE dwd.dwd_inv_proj_resc_dtl_d DROP PARTITION IF EXISTS p20240928;
ALTER TABLE dwd.dwd_inv_proj_resc_dtl_d ADD PARTITION IF NOT EXISTS p20240928 VALUES IN ('2024-09-28');

INSERT INTO dwd.dwd_inv_proj_resc_dtl_d PARTITION (p20240928)
SELECT NULL AS proj_md_code
,t1.inv_pro_id AS proj_code
,t1.reply_category AS resc_type
,round(t1.jaf, 2) AS const_install_fee
,round(t1.zcf, 2) AS relocation_fee
,round(t1.glf, 2) AS manage_fee
,round(t1.jlf, 2) AS supervision_fee
,round(t1.kcsjf, 2) AS survey_design_fee
,round(t1.oth, 2) AS other
,round((t1.jaf + t1.zcf + t1.glf + t1.jlf + t1.kcsjf + t1.oth), 2) AS resc_tot_amt
,t1.reply_date AS resc_date
,t1.pg_pf AS eva_resc
,t1.bz AS remark
,current_timestamp() AS etl_time
,'' AS source_system
,'ods_cfhec_pro_inv_basic_pfinfo_f_d' AS source_table
,'2024-09-28' AS etl_part
FROM ods.ods_cfhec_pro_inv_basic_pfinfo_f_d PARTITION (p20240928)
;


执行方式1:

整体选中执行(上面的SQL语句), 当FROM 的表名, 没有别名, 居然可以执行通过, 如

  1. ALTER TABLE DROP PARTITION
  2. ALTER TABLE ADD PARTITION
  3. INSERT INTO SELECT FROM -- 注: 当FROM 的表名, 没有别名, 居然可以执行通过

执行方式2:

当单独执行 INSERT INTO SELECT FROM 时, 才能正常检测出语法错误

INSERT INTO dwd.dwd_inv_proj_resc_dtl_d PARTITION (p20240928)
SELECT NULL AS proj_md_code
,t1.inv_pro_id AS proj_code
,t1.reply_category AS resc_type
,round(t1.jaf, 2) AS const_install_fee
,round(t1.zcf, 2) AS relocation_fee
,round(t1.glf, 2) AS manage_fee
,round(t1.jlf, 2) AS supervision_fee
,round(t1.kcsjf, 2) AS survey_design_fee
,round(t1.oth, 2) AS other
,round((t1.jaf + t1.zcf + t1.glf + t1.jlf + t1.kcsjf + t1.oth), 2) AS resc_tot_amt
,t1.reply_date AS resc_date
,t1.pg_pf AS eva_resc
,t1.bz AS remark
,current_timestamp() AS etl_time
,'' AS source_system
,'ods_cfhec_pro_inv_basic_pfinfo_f_d' AS source_table
,'2024-09-28' AS etl_part
FROM ods.ods_cfhec_pro_inv_basic_pfinfo_f_d PARTITION (p20240928)
;

8c8f31053da2976f75eb4daa16a8bb8
d6c839287cedf09f8fefa2aba8694e4
37b5cdc088500fb866e0d8daf0ee50f

What You Expected?

严重bug

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant