lambda_udf.sql 361 B

12345678910111213141516
  1. /* postgres can not */
  2. /* syntax version 1 */
  3. USE plato;
  4. $shiftSteps = 1;
  5. $linear = ($x, $z) -> {
  6. $v = 10 * $z + $x;
  7. $shift = ($item) -> {
  8. return $item << $shiftSteps
  9. };
  10. $res = Math::Floor(Math::Pi() * $shift($v));
  11. return $res
  12. };
  13. --INSERT INTO Output
  14. SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64)) as linear FROM Input as t;