-
Notifications
You must be signed in to change notification settings - Fork 96
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
Implement BaseCompositePhysicalTable #242
Conversation
The changes seem fine. Rick and I discussed at some point whether or not we should take out the 'we'll calculate the grain for you' from the composite tables and replace it with only passing in an acceptable grain. |
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.
Nothing too big
*/ | ||
public class BaseCompositePhysicalTable extends BasePhysicalTable { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(MetricUnionCompositeTable.class); |
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.
Wrong logger
) { | ||
super( | ||
name, | ||
IntervalUtils.getCoarsestTimeGrain(physicalTables).orElseThrow(() -> { |
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.
As commented before, just take in the grain, don't compute it. A param will need to be added, and the javadoc for physicalTables
likely needs to be updated as well.
if (!physicalTables.stream() | ||
.map(PhysicalTable::getSchema) | ||
.map(PhysicalTableSchema::getTimeGrain) | ||
.allMatch(grain -> grain.satisfiedBy(coarsestTimeGrain))) { |
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.
Can switch to a method reference for the new satisfies
method on grain: coarsestTimeGrain::satisfies
.map(PhysicalTableSchema::getTimeGrain) | ||
.allMatch(grain -> grain.satisfiedBy(coarsestTimeGrain))) { | ||
String message = String.format("There is no mutually satisfying grain among: %s for current table " + | ||
"%s", |
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.
When wrapping, chop-wrap all parameters. That also means that the string doesn't need to be split either:
String message = String.format(
"There is no mutually satisfying grain among: %s for current table %s",
physicalTables,
name.asName()
);
PR #195 reveals a need to implement a common class between
PartitionCompositeTable
andMetricUnionCompositeTable
.