You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "SML0127 (via GitHub)" <gi...@apache.org> on 2025/08/10 07:24:47 UTC
[PR] [lake/iceberg] Support IcebergLakeCatalog for Log Tables [fluss]
SML0127 opened a new pull request, #1508:
URL: https://github.com/apache/fluss/pull/1508
<!--
*Thank you very much for contributing to Fluss - we are happy that you want to help us improve Fluss. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
## Contribution Checklist
- Make sure that the pull request corresponds to a [GitHub issue](https://github.com/alibaba/fluss/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no issue.
- Name the pull request in the format "[component] Title of the pull request", where *[component]* should be replaced by the name of the component being changed. Typically, this corresponds to the component label assigned to the issue (e.g., [kv], [log], [client], [flink]). Skip *[component]* if you are unsure about which is the best component.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes.
- Each pull request should address only one issue, not mix up code from multiple issues.
**(The sections below can be removed for hotfixes or typos)**
-->
### Purpose
<!-- Linking this pull request to the issue -->
Linked issue: close https://github.com/apache/fluss/issues/1329
<!-- What is the purpose of the change -->
### Brief change log
- support log table in IcebergLakeCatalog
<!-- Please describe the changes made in this pull request and explain how they address the issue -->
### Tests
In progress
<!-- List UT and IT cases to verify this change -->
### API and Format
<!-- Does this change affect API or storage format -->
### Documentation
<!-- Does this change introduce a new feature -->
--
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
Re: [PR] [lake/iceberg] Support Log Table in IcebergLakeCatalog [fluss]
Posted by "SML0127 (via GitHub)" <gi...@apache.org>.
SML0127 commented on PR #1508:
URL: https://github.com/apache/fluss/pull/1508#issuecomment-3179467156
@luoyuxia @MehulBatra Thank you for the reviews. I've adrressed all feedback.
--
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
Re: [PR] [lake/iceberg] Support Log Table in IcebergLakeCatalog [fluss]
Posted by "MehulBatra (via GitHub)" <gi...@apache.org>.
MehulBatra commented on PR #1508:
URL: https://github.com/apache/fluss/pull/1508#issuecomment-3178643440
LGTM aswell, Thank you for the great work!
--
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
Re: [PR] [lake/iceberg] Support Log Table in IcebergLakeCatalog [fluss]
Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia commented on code in PR #1508:
URL: https://github.com/apache/fluss/pull/1508#discussion_r2268770153
##########
fluss-lake/fluss-lake-iceberg/src/main/java/com/alibaba/fluss/lake/iceberg/IcebergLakeCatalog.java:
##########
@@ -204,21 +208,47 @@ private PartitionSpec createPartitionSpec(
new IllegalArgumentException(
"Bucket count (bucket.num) must be set"));
- if (bucketKeys.isEmpty()) {
- throw new IllegalArgumentException(
- "Bucket key must be set for primary key Iceberg tables");
- }
+ // Only support one bucket key for now
if (bucketKeys.size() > 1) {
throw new UnsupportedOperationException(
"Only one bucket key is supported for Iceberg at the moment");
}
+ // pk table must have bucket key
+ if (bucketKeys.isEmpty() && isPkTable) {
+ throw new IllegalArgumentException(
+ "Bucket key must be set for primary key Iceberg tables");
+ }
+
+ // bucket key must exist in schema
Review Comment:
We can remove this check since it already been checked before call method `IcebergLakeCatalog#createTable`
##########
fluss-lake/fluss-lake-iceberg/src/main/java/com/alibaba/fluss/lake/iceberg/IcebergLakeCatalog.java:
##########
@@ -145,10 +143,11 @@ private void createTable(TablePath tablePath, Catalog.TableBuilder tableBuilder)
}
}
- public Schema convertToIcebergSchema(TableDescriptor tableDescriptor) {
+ public Schema convertToIcebergSchema(TableDescriptor tableDescriptor, boolean isPkTable) {
List<Types.NestedField> fields = new ArrayList<>();
int fieldId = 1;
Review Comment:
Could you modify `int fieldId = 1;` to `int fieldId = 0;` for I just found that flink/spark all from `fieldId=0` to create iceberg table field.
--
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
Re: [PR] [lake/iceberg] Support Log Table in IcebergLakeCatalog [fluss]
Posted by "MehulBatra (via GitHub)" <gi...@apache.org>.
MehulBatra commented on code in PR #1508:
URL: https://github.com/apache/fluss/pull/1508#discussion_r2269354933
##########
fluss-lake/fluss-lake-iceberg/src/main/java/com/alibaba/fluss/lake/iceberg/IcebergLakeCatalog.java:
##########
@@ -145,10 +143,11 @@ private void createTable(TablePath tablePath, Catalog.TableBuilder tableBuilder)
}
}
- public Schema convertToIcebergSchema(TableDescriptor tableDescriptor) {
+ public Schema convertToIcebergSchema(TableDescriptor tableDescriptor, boolean isPkTable) {
Review Comment:
Instead of boolean isPkTable can we think of using an enum it make things more clear/self explaining, extensible and might reduce logic duplication
```
public enum TableType {
PRIMARY_KEY,
LOG;
public boolean isPrimaryKey() {
return this == PRIMARY_KEY;
}
public boolean isLog() {
return this == LOG;
}
}
```
```
convertToIcebergSchema(td, TableType.PRIMARY_KEY);
```
Instead of
```
convertToIcebergSchema(td, true);
```
What do you guys think @SML0127 @luoyuxia ? please feel free to add your inputs
--
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
Re: [PR] [lake/iceberg] Support Log Table in IcebergLakeCatalog [fluss]
Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia commented on code in PR #1508:
URL: https://github.com/apache/fluss/pull/1508#discussion_r2269500488
##########
fluss-lake/fluss-lake-iceberg/src/main/java/com/alibaba/fluss/lake/iceberg/IcebergLakeCatalog.java:
##########
@@ -145,10 +143,11 @@ private void createTable(TablePath tablePath, Catalog.TableBuilder tableBuilder)
}
}
- public Schema convertToIcebergSchema(TableDescriptor tableDescriptor) {
+ public Schema convertToIcebergSchema(TableDescriptor tableDescriptor, boolean isPkTable) {
Review Comment:
I feel it may be over-design, I think `isPkTable` is also self explaining and simpler
--
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
Re: [PR] [lake/iceberg] Support Log Table in IcebergLakeCatalog [fluss]
Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia merged PR #1508:
URL: https://github.com/apache/fluss/pull/1508
--
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