aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/lambda/lambda_duplicate_arg.sqlx
blob: 9b504d6a76faa80608b3854ff58c776b25d1f942 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* postgres can not */
USE plato;

$shiftSteps=1;
$linear = ($x, $z, $x)->{ -- $x is duplicated
  $v = 10 * $z + $x;
  $shift = ($item) -> {return $item << $shiftSteps};
  $res = Math::Floor(Math::Pi() * $shift($v));
  return $res
};

--INSERT INTO Output
SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64)) FROM Input as t;