struct_merge.sql 411 B

1234567891011121314
  1. /* syntax version 1 */
  2. $merge = ($_name, $l, $r) -> { return Coalesce($l, 0) + Coalesce($r, 0); };
  3. $left = <|a: 1, b: 2, c: 3|>;
  4. $right = <|c: 1, d: 2, e: 3|>;
  5. SELECT
  6. StructUnion($left, $right),
  7. StructUnion($left, $right, $merge),
  8. StructIntersection($left, $right),
  9. StructIntersection($left, $right, $merge),
  10. StructDifference($left, $right),
  11. StructSymmetricDifference($left, $right)
  12. ;