Conversation
* Support Accumulator for avg duration * Add tests
* doc:Add documentation for OPTIONS clause syntax * doc:rename write_options.md to format_options.md and clarify its scope for both reading and writing * doc: change dml.md, cuz still have wrong write_options filename * doc: update doctest reference to renamed format_options.md * docs: update and correct format options documentation * doc: add more information of options content * remove execution settings, move note about insert * wordsmith example --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
|
🚨 gitStream Monthly Automation Limit Reached 🚨 Your organization has exceeded the number of pull requests allowed for automation with gitStream. To continue automating your PR workflows and unlock additional features, please contact LinearB. |
Reviewer's Guide by SourceryThis pull request includes several enhancements and refactorings. It introduces support for average aggregation on duration types, refactors the expression simplification process to track transformations, and renames the write options documentation to format options, updating related references. Sequence diagram for expression simplification with cycle countsequenceDiagram
participant ExprSimplifier
participant Simplifier
participant ConstEvaluator
participant ShortenInListSimplifier
ExprSimplifier->>Simplifier: new()
ExprSimplifier->>ConstEvaluator: try_new()
ExprSimplifier->>ShortenInListSimplifier: new()
loop until no transformation or max cycles
ExprSimplifier->>Simplifier: transform(expr)
activate Simplifier
Simplifier-->>ExprSimplifier: Transformed {data, transformed}
deactivate Simplifier
alt transformed
ExprSimplifier->>ConstEvaluator: transform(expr)
activate ConstEvaluator
ConstEvaluator-->>ExprSimplifier: Transformed {data, transformed}
deactivate ConstEvaluator
end
end
ExprSimplifier->>ShortenInListSimplifier: rewrite(expr)
activate ShortenInListSimplifier
ShortenInListSimplifier-->>ExprSimplifier: Transformed {data, transformed}
deactivate ShortenInListSimplifier
Updated class diagram for AvgAccumulatorclassDiagram
class Avg {
<<AggregateUDFImpl>>
}
class DurationAvgAccumulator {
sum: Option<i64>
count: u64
time_unit: TimeUnit
result_unit: TimeUnit
update_batch(values: &[ArrayRef]) Result<()>
evaluate() Result<ScalarValue>
state() Result<Vec<ScalarValue>>
merge_batch(states: &[ArrayRef]) Result<()>
retract_batch(values: &[ArrayRef]) Result<()>
supports_retract_batch() bool
}
Avg -- DurationAvgAccumulator : Creates when input is Duration
Updated class diagram for ExprSimplifierclassDiagram
class ExprSimplifier {
-max_simplifier_cycles: u32
+simplify(expr: Expr) Result<Expr>
+simplify_with_cycle_count_transformed(expr: Expr) Result<(Transformed<Expr>, u32)>
+with_max_cycles(max_cycles: u32) ExprSimplifier
}
class Transformed {
data: Expr
transformed: bool
}
ExprSimplifier -- Transformed : Returns
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by Sourcery
Enhance DataFusion's aggregate functions and expression simplification, and update documentation to reflect format options
New Features:
Enhancements:
Documentation: