Skip to content

Commit

Permalink
fix: sums that return int8 should be marked with the meaning field
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitRanque committed Jan 6, 2025
1 parent 2f470ec commit 04e0f57
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/connectors/ndc-postgres/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ pub fn get_schema(
function_name.as_str(),
function_definition.return_type.as_str(),
) {
// Mark SUM aggregations returning a f64 (float8) with the meaning tag.
// The spec wants SUM aggregations to return scalars represented as either f64 or i64
// i64 (int8) is represented as a string, so we omit it here
("sum", "float8") => models::AggregateFunctionDefinition::Sum {
result_type: function_definition.return_type.clone().into(),
},
("sum", "float8" | "int8") => {
models::AggregateFunctionDefinition::Sum {
result_type: function_definition.return_type.clone().into(),
}
}
("max", _) => models::AggregateFunctionDefinition::Max,
("min", _) => models::AggregateFunctionDefinition::Min,
// Mark AVG aggregations returning a f64 (float8) with the meaning tag
Expand Down

0 comments on commit 04e0f57

Please sign in to comment.