summaryrefslogtreecommitdiffstats
path: root/yt/yql/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.yql
blob: 7672cec89e0a3325d9af5c5402a36c2462cafae1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
/* syntax version 1 */
/* postgres can not */
USE plato;

$cast_to_double = ($column) -> {
    RETURN CAST($column as Double);
};
$column_name = 'key';
SELECT AVG($cast_to_double($column_name))
FROM Input;