-
Notifications
You must be signed in to change notification settings - Fork 81
Write daily IRs for incremental aggregation #998
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
base: main
Are you sure you want to change the base?
Conversation
s"${aggregationPart.inputColumn}_$opSuffix${aggregationPart.window.suffix}${bucketSuffix}" | ||
|
||
def incOutputColumnName = | ||
s"${aggregationPart.inputColumn}_$opSuffix${bucketSuffix}" |
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.
should we still keep the aggregationPart.window.suffix
? Otherwise, how do we reconstruct the final output column?
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.
@pengyu-hou not sure I get it. I can not use the window.suffix right as the intermediate incremental is daily aggregation.
.toArray | ||
.zip(columnAggregators.map(_.irType)) | ||
|
||
val incSchema = aggregationParts |
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.
I am thinking that we should use a full incremental
in the code and we can keep inc
as the suffix for the table so the table names are not getting too long. What do you think?
val incSchema = aggregationParts | |
val incrementalSchema = aggregationParts |
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.
yes. good to use full name.
def cleanName: String = metaData.name.sanitize | ||
|
||
def outputTable = s"${metaData.outputNamespace}.${metaData.cleanName}" | ||
def incrementalOutputTable = s"${metaData.outputNamespace}.${metaData.cleanName}_inc" |
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.
def incrementalOutputTable = s"${metaData.outputNamespace}.${metaData.cleanName}_inc" | |
def incrementalOutputTable = s"${metaData.outputNamespace}.${metaData.cleanName}_daily_inc" |
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.
@abbywh I think we already have a daily here.
} | ||
} | ||
|
||
class AverageIR extends SimpleAggregator[Array[Any], Array[Any], Double] { |
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.
It looks to me like this mostly exists to serialize aggregators. Is there something more generic we can do? @nikhilsimha and I talked about https://fory.apache.org/ for example, but it could be even simpler to moving this logic into a different class abstraction
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.
I agree that if we could somehow make it more general, then we would not have to implement for each operation.
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.
also cc @nikhil-zlai 😁
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.
I was thinking of sticking with Avro because it is what we used for the online serving path so that we can keep the ser//de logic same.
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.
I think the issue with Avro is that it needs to schematize the object, whereas hopIR is just an Array[Any]. If you just reflect the hopIR, there is no need to schematize it.
Summary
Why / Goal
Test Plan
Checklist
Reviewers