-
Notifications
You must be signed in to change notification settings - Fork 2k
[Enhancement] Support analyze iceberg table with partition transform #39907
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
Conversation
Signed-off-by: Youngwb <[email protected]>
fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergPartitionUtils.java
Show resolved
Hide resolved
return null; | ||
} | ||
|
||
|
||
public long nextPartitionId() { | ||
return partitionIdGen.getAndIncrement(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most risky bug in this code is:
Potential null pointer access in the call to getNativeTable().spec()
if getNativeTable()
returns null
.
You can modify the code like this:
public PartitionField getPartitionField(String partitionColumnName) {
NativeTable nativeTable = getNativeTable();
if (nativeTable == null) {
return null; // or throw an exception depending on expected behavior
}
List<PartitionField> allPartitionFields = nativeTable.spec().fields();
Schema schema = nativeTable.schema();
for (PartitionField field : allPartitionFields) {
if (getPartitionSourceName(schema, field).equalsIgnoreCase(partitionColumnName)) {
return field;
}
}
return null;
}
fe/fe-core/src/main/java/com/starrocks/statistic/ExternalFullStatisticsCollectJob.java
Show resolved
Hide resolved
Signed-off-by: Youngwb <[email protected]>
Signed-off-by: Youngwb <[email protected]>
Signed-off-by: Youngwb <[email protected]>
|
[FE Incremental Coverage Report]✅ pass : 45 / 53 (84.91%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
@Mergifyio backport branch-3.2 |
✅ Backports have been created
|
…39907) Signed-off-by: Youngwb <[email protected]> (cherry picked from commit 1dc523c)
…(backport #39907) (#40347) Co-authored-by: Youngwb <[email protected]>
…tarRocks#39907) Signed-off-by: Youngwb <[email protected]> Signed-off-by: liubotao <[email protected]>
Why I'm doing:
Iceberg table with partition transform would not work normally
What I'm doing:
iceberg has partition transform like year/month/day/hour, so we need to map partition column to range with year/month/day/hour, eg. ts is partition column and type is date with year transform,
origin predicate is ts = '2022',
but ts with year partition transform needs predicate
ts >= '2022-01-01' and ts < '2023-01-01';
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: