Skip to content

Commit e41b1a9

Browse files
Support more SQL functions
1 parent 3ff6ae6 commit e41b1a9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

components/expression.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,7 @@ def _EvaluateFunction(cls, opds, func):
218218
# TODO(lnishan): Add new function names to definitions.py
219219
# Function: abs, avg, count, max, min, sum, ascii, concat, concat_ws, find_in_set, insert, instr, length, locate, lcase, lower, left, mid, repeat, right, replace, strcmp, substr, substring, ucase, upper
220220
rows = len(opds)
221-
if func == "abs":
222-
abss = abs(row[-1] for row in opds)
223-
res = []
224-
for i in range(rows):
225-
res.append(abss)
226-
return res
227-
elif func == "avg":
221+
if func == "avg":
228222
avg = sum(row[-1] for row in opds) / float(rows)
229223
res = []
230224
for i in range(rows):

0 commit comments

Comments
 (0)