summaryrefslogtreecommitdiffstats
path: root/yt/yql/tests/sql/suites/limit/dynamic_sort_limit.yql
blob: 96e033df95d5bb4ce8c458367f0eea5201ec16e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* postgres can not */
/* syntax version 1 */
USE plato;

$script = @@
def f(s):
  return int(s)
@@;

$callable = Python::f(Callable<(String)->Uint64?>,$script);

$i = unwrap($callable("2"));

SELECT
    key,
    SOME(value) as value
FROM Input
GROUP BY key
ORDER BY key LIMIT $i;