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

Support parsing SQL Server SELECT pglogical.replication_set_add_all_tables('myreplicationset', sql #29175 #30189

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

yydeng626
Copy link
Collaborator

Fixes #29175.

Changes proposed in this pull request:

  • support rownumber function parser
  • support following sql case
1. SELECT session_id as SPID, command, a.text AS Query, start_time, percent_complete
  , dateadd(second,estimated_completion_time/1000, getdate()) as estimated_completion_time
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) a
WHERE r.command in ('BACKUP DATABASE','RESTORE DATABASE')

2. SELECT * FROM (
SELECT col1, ROW_NUMBER () OVER (PARTITION by col1 ORDER BY col1) rn
FROM tab1 WHERE col1='XYZ'
) WHERE rn = 1

3. SELECT count(*)
FROM input 
GROUP BY  clusterid, tumblingwindow (minutes, 5)
  • not sql server syntax case
// Azure Database for PostgreSQL syntax not sql server , do not parser , see [Azure Database for PostgreSQL Reference](https://learn.microsoft.com/zh-cn/azure/postgresql/flexible-server/concepts-logical)
1. SELECT pglogical.replication_set_add_all_tables('myreplicationset', '{public}'::text[])
2. SELECT pglogical.replication_set_add_all_tables('default', ARRAY['testUser'])

Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.

@strongduanmu strongduanmu merged commit 19d27b9 into apache:master Feb 19, 2024
139 checks passed
@yydeng626 yydeng626 deleted the 29175 branch February 19, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support parsing SQL Server SELECT pglogical.replication_set_add_all_tables('myreplicationset', sql
2 participants