You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "raminqaf (via GitHub)" <gi...@apache.org> on 2026/10/14 09:02:06 UTC
[I] [flink] DISTRIBUTED BY is silently ignored when creating tables and materialized tables [fluss]
raminqaf opened a new issue, #4639:
URL: https://github.com/apache/fluss/issues/4639
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar.
### Fluss version
main (development)
### Please describe the bug 🐞
The Fluss catalog ignores the `DISTRIBUTED BY` clause, so the table gets the default bucket count and bucket key. This also affects the 1.0.0 release.
```sql
CREATE TABLE orders (
id INT, region STRING, amt INT, PRIMARY KEY (id, region) NOT ENFORCED
) DISTRIBUTED BY HASH(id) INTO 4 BUCKETS;
```
| Declared | Created today |
|-------------------------------------------|------------------------------------------------------|
| `DISTRIBUTED BY HASH(id) INTO 4 BUCKETS` | Bucket key `id, region`, server default bucket count |
| `DISTRIBUTED BY RANGE(id) INTO 4 BUCKETS` | Accepted, the clause is dropped |
| `DISTRIBUTED BY ...` plus `'bucket.num'` | Accepted, the clause is dropped |
`FlinkConversions#toFlussTable` reads buckets only from the `bucket.key` and `bucket.num` options and never reads `getDistribution()`. Flink has a guard: `DynamicSinkUtils#validateBucketing` rejects distributed tables whose sink lacks `SupportsBucketing`. That guard never fires here, because the table read back from Fluss has no distribution.
This affects `CREATE TABLE` since Flink 1.20 (FLIP-376) and `CREATE MATERIALIZED TABLE` since Flink 2.2 (FLIP-542).
### Solution
Map `DISTRIBUTED BY HASH(k) INTO n BUCKETS` to bucket key `k` and bucket count `n`. `DISTRIBUTED INTO n BUCKETS` sets only the count. Reject `RANGE`, and reject combining the clause with the `bucket.key` or `bucket.num` options. Flink 1.18 and 1.19 have no `DISTRIBUTED BY`, so their adapters return nothing. `ALTER TABLE ... MODIFY DISTRIBUTION` is out of scope. It keeps failing with the existing "Unsupported flink table change" error.
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [flink] DISTRIBUTED BY is silently ignored when creating tables and materialized tables [fluss]
Posted by "fresh-borzoni (via GitHub)" <gi...@apache.org>.
fresh-borzoni closed issue #4639: [flink] DISTRIBUTED BY is silently ignored when creating tables and materialized tables
URL: https://github.com/apache/fluss/issues/4639
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org