shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Postgresql : not support function row_number()

Open agoodcoolman opened this issue 1 year ago • 9 comments

Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

5.4.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy apache-shardingsphere-5.4.1-shardingsphere-proxy-bin

Expected behavior

create table sql CREATE TABLE memberinfo ( id INT PRIMARY KEY, name VARCHAR(50), idcard VARCHAR(50), house_id VARCHAR(50),relation INT;

insert into sample data. insert into memberinfo (id, name, idcard, house_id, relation) values (1, '张三', '421106199901011234', "123456houseid", 1) ,(2, '李四', '42110619900101789', "123456houseid", 1)

query sql select house_id, relation, row_number() over (partition by house_id ORDER BY relation asc ) AS relation_index from memberinfo where house_id = '123456houseid'

sharding-config

image

###expected result:
image

Actual behavior

relation_xuhao coloum 1,1 is error. image

expected result relation_index is 1,2. image

Reason analyze (If you can)

in postgrmaybe not support.

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

in database: Postgresql
query sql 'select house_id, relation, row_number() over (partition by house_id ORDER BY relation asc ) AS relation_index from memberinfo where house_id = '123456houseid''

in Postgresql, function row_number() is not work

agoodcoolman avatar Nov 23 '23 09:11 agoodcoolman

Hi @agoodcoolman , Thanks for your feedback, are you intrested in improving it?

RaigorJiang avatar Nov 23 '23 15:11 RaigorJiang

I'll try it.

agoodcoolman avatar Nov 24 '23 01:11 agoodcoolman

@RaigorJiang sorry, I don't have time to modify this issue.

agoodcoolman avatar Nov 30 '23 08:11 agoodcoolman

@agoodcoolman OK, I'll mark this issue as volunteer wanted, thank you~

RaigorJiang avatar Dec 01 '23 03:12 RaigorJiang

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

github-actions[bot] avatar Dec 31 '23 20:12 github-actions[bot]

mysql not support ROW_NUMBER() OVER (ORDER BY id) too ,in shardingshpere5.3.2 @RaigorJiang dose it will support in next version? or plan to support it

zt9788 avatar Jan 09 '24 06:01 zt9788

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

github-actions[bot] avatar Feb 09 '24 20:02 github-actions[bot]

Hey @agoodcoolman I've been trying to reproduce the issue, using ShardingSphereProxy 5.4.1 and Postgres 16.2 with Zookeeper 3.9.2 as Cluster Type . Have used the sharding-config you have posted (naming it as sharding_db).

But row_number() seems to be working fine:

Screenshot 2024-04-20 at 2 55 45 AM

can you share postgres version, mode configuration and probably a sample dataset to look into this further.

also, @RaigorJiang , i'll like to try resolving this issue. Thanks

shubham-j-sde avatar Apr 19 '24 21:04 shubham-j-sde

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

github-actions[bot] avatar May 21 '24 20:05 github-actions[bot]