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

fix(flink): fix flinksql syntax error about ROW and function using #383

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

Cythia828
Copy link
Collaborator

@Cythia828 Cythia828 commented Jan 2, 2025

修复FlinkSQL语法错误飘红问题 #382

发现问题方

stream产品客户方发现,具体禅道地址:http://zenpms.dtstack.cn/zentao/bug-view-123456.html

出现报错sql

create view v_search_product as select * from ( select request_id, click_time, date_format (click_time, 'yyyy-MM-dd') as click_date, cast(wid as bigint) as wid, query, row_number() over ( partition by wid, date_format (click_time, 'yyyy-MM-dd') order by click_time ) as ranks from search_product where wid is not null and wid <> 'None' and date_format (click_time, 'yyyy-MM-dd') >= to_date ('2024-12-04', 'yyyy-MM-dd') ) t where ranks = 1 and wid > 0;

出现飘红原因

  • 数据类型ROW的使用可以ROW<>也可以ROW(),而我们语法文件只支持了ROW<>
    参考文档地址
image - 在使用`partition by`时,后面即可以接字段也可以接方法

基础使用文档

验证截图

image

src/grammar/flink/FlinkSqlParser.g4 Outdated Show resolved Hide resolved
Copy link
Collaborator

@LuckyFBB LuckyFBB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@Cythia828 Cythia828 added the bug Something isn't working label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants