Skip to content

Commit

Permalink
Add remaining TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Jan 24, 2025
1 parent ce9d4bc commit 59fa4ce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ internal class AccumulatorAvgDynamic : Accumulator() {
private var count: Long = 0L
private var accumulatorType: AccumulatorType? = null

// TODO: need to take another look at variant lowering and casing here
override fun nextValue(value: Datum) {
checkIsNumberType(funcName = "AVG", value = value)
if (sum == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ internal class AccumulatorSumDouble : Accumulator() {
internal class AccumulatorSumDynamic : Accumulator() {
var sum: Number? = null
private var accumulatorType: AccumulatorType? = null

// TODO: need to take another look at variant lowering and casing here
override fun nextValue(value: Datum) {
checkIsNumberType(funcName = "SUM", value = value)
// Initialize `sum` and `accumulatorType`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ internal object FunctionUtils {
}
}

// TODO: this should likely return the value of the datum so that if it is a variant, we don't need to lower again
internal fun checkIsNumberType(funcName: String, value: Datum) {
if (value.type.code() == PType.VARIANT) {
return checkIsNumberType(funcName, value.lower())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ internal object NumberUtils {
APPROX
}

// TODO docs
// If types of the current sum and value are dynamic, use this function with the given `AccumulatorType`.
fun add(curSum: Number, value: Datum, type: AccumulatorType): Number {
return when (type) {
AccumulatorType.INTEGRAL -> {
Expand Down

0 comments on commit 59fa4ce

Please sign in to comment.