We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using ShardingSphere-Proxy with AlloyDB and I am facing an error when trying to insert data into the ni_contribuinte table.
ni_contribuinte
INSERT
rtc_db_des_aa=> INSERT INTO identifier(identifier) VALUES ('1a2b3c4d5e'); ERROR: Inline sharding algorithms expression 'shard_${(abs(identifier.hashCode())) % 5}' and sharding column 'identifier' do not match.
My table schema is as follows:
Table "identifier" { "identifier" "character varying(14)" [pk, not null] }
And my ShardingSphere configuration is as follows:
databaseName: rtc_db_des_aa dataSources: shard_0: url: jdbc:postgresql://10.0.0.2:5432/rtc_db_des_aa username: postgres password: "pass" shard_1: url: jdbc:postgresql://10.0.0.7:5432/rtc_db_des_aa username: postgres password: "pass" shard_2: url: jdbc:postgresql://10.0.0.8:5432/rtc_db_des_aa username: postgres password: "pass" shard_3: url: jdbc:postgresql://10.0.0.9:5432/rtc_db_des_aa username: postgres password: "pass" shard_4: url: jdbc:postgresql://10.0.0.10:5432/rtc_db_des_aa username: postgres password: "pass" rules: - !SHARDING tables: identifier: actualDataNodes: shard_${0..4}.identifier tableStrategy: standard: shardingColumn: identifier shardingAlgorithmName: hash_inline shardingAlgorithms: hash_inline: type: INLINE props: sharding-count: 5 algorithm-expression: shard_${(abs(identifier.hashCode())) % 5}
From the error, it seems that the sharding expression is not being applied correctly to the identifier column. What could be causing this?
identifier
character varying(14)
Could someone help me understand what the problem might be?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sharding error when inserting data into ShardingSphere-Proxy with AlloyDB
I am using ShardingSphere-Proxy with AlloyDB and I am facing an error when trying to insert data into the
ni_contribuinte
table.Error when executing an
INSERT
:My table schema is as follows:
And my ShardingSphere configuration is as follows:
From the error, it seems that the sharding expression is not being applied correctly to the
identifier
column. What could be causing this?I have already tried:
identifier
column is correctly set tocharacter varying(14)
.Could someone help me understand what the problem might be?
The text was updated successfully, but these errors were encountered: