norange.sql 565 B

123456789101112131415161718192021
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. /* yt can not */
  4. pragma warning("disable", "4510");
  5. $opt_type = Struct<x:Int32?, y:Int32?, z:String?, t:String?>;
  6. $xy_keys = AsTuple(AsAtom("x"), AsAtom("y"));
  7. $range_for = ($pred) -> (YQL::RangeComputeFor($opt_type, $pred, $xy_keys));
  8. $pred1 = ($row) -> (($row.x + $row.y > 0) ?? false);
  9. $pred2 = ($row) -> (($row.x > 0 or $row.y > 0) ?? false);
  10. $pred3 = ($row) -> (($row.x > 0 or $row.z == "test") ?? false);
  11. select
  12. $range_for($pred1) is null,
  13. $range_for($pred2) is null,
  14. $range_for($pred3) is null,
  15. ;