Skip to content

Commit

Permalink
fix: PI functions and program to handle Doris/CH double type (#19769)
Browse files Browse the repository at this point in the history
  • Loading branch information
luciano-fiandesio authored Jan 26, 2025
1 parent 2b28ecf commit d926404
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public Object getSql(ExprContext ctx, CommonExpressionVisitor visitor) {
sql += "case when " + visitor.visitAllowingNulls(c) + " >= 0 then 1 else 0 end + ";
}

return TextUtils.removeLast(sql, "+").trim() + ") as double precision),0)";
return TextUtils.removeLast(sql, "+").trim()
+ ") as %s),0)".formatted(visitor.getSqlBuilder().dataTypeDouble());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public Object getSql(CommonExpressionVisitor visitor) {
sql += "case when " + SqlUtils.quote(uid) + " is not null then 1 else 0 end + ";
}

return TextUtils.removeLast(sql, "+").trim() + ") as double precision),0)";
return TextUtils.removeLast(sql, "+").trim()
+ ") as %s),0)".formatted(visitor.getSqlBuilder().dataTypeDouble());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public Object getSql(CommonExpressionVisitor visitor) {
sql += "case when " + SqlUtils.quote(uid) + " >= 0 then 1 else 0 end + ";
}

return TextUtils.removeLast(sql, "+").trim() + ") as double precision),0)";
return TextUtils.removeLast(sql, "+").trim()
+ ") as %s),0)".formatted(visitor.getSqlBuilder().dataTypeDouble());
}
}

0 comments on commit d926404

Please sign in to comment.