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

$shiftSteps=1;
$linear = ($x, $z)->{
  $v = 10 * $z + $x;
  $shift = ($item) -> {return $item << $shiftSteps};
  return $shift($v)
};

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