def protocol(): # 3 columns for party 1 a = create_column("a", "INTEGER") b = create_column("b", "INTEGER") c = create_column("c", "INTEGER") # 3 columns for party 2 d = create_column("d", "INTEGER") e = create_column("e", "INTEGER") f = create_column("f", "INTEGER") # 3 columns for party 3 g = create_column("g", "INTEGER") h = create_column("h", "INTEGER") i = create_column("i", "INTEGER") # create all input relations rel_one = lang.create("in1", [a, b, c], {1}) rel_two = lang.create("in2", [d, e, f], {2}) rel_three = lang.create("in3", [g, h, i], {3}) # concatenate input relations cc = lang.concat([rel_one, rel_two, rel_three], "cc") # compute deciles of values in column "a" agg = lang.deciles(cc, "dec_out", [], "a") # collect output lang.collect(agg, {1, 2, 3}) # return the workflow's root nodes return {rel_one, rel_two, rel_three}
def protocol(): # 3 columns for party 1 a = create_column("a", "INTEGER") b = create_column("b", "INTEGER") c = create_column("c", "INTEGER") # 3 columns for party 2 d = create_column("d", "INTEGER") e = create_column("e", "INTEGER") f = create_column("f", "INTEGER") # 3 columns for party 3 g = create_column("g", "INTEGER") h = create_column("h", "INTEGER") i = create_column("i", "INTEGER") # create all input relations rel_one = lang.create("in1", [a, b, c], {1}) rel_two = lang.create("in2", [d, e, f], {2}) rel_three = lang.create("in3", [g, h, i], {3}) # concatenate input relations cc = lang.concat([rel_one, rel_two, rel_three], "cc") # simple sum aggregation over column "a", grouped by the values # from column "b". # note that since we didn't explicitly pass column names to concat(), # the columns in its output relation were named according to the first # relation in its input (here, relation rel_one). agg = lang.aggregate(cc, "agg", ["b"], "a", "sum") # reveal output to parties 1, 2, and 3 lang.collect(agg, {1, 2, 3}) # return the workflow's root nodes return {rel_one, rel_two, rel_three}
def protocol(): # 3 columns for input dataset (shared between parties {1, 2, 3} a = create_column("a", "INTEGER") b = create_column("b", "INTEGER") c = create_column("c", "INTEGER") # create shared input relation rel_one = lang.create("inpt", [a, b, c], {1, 2, 3}) # simple sum aggregation over column "a", with no key columns agg = lang.aggregate(rel_one, "agg", None, "a", "sum") # reveal output to parties 1, 2, and 3 lang.collect(agg, {1, 2, 3}) # return the workflow's root node return {rel_one}
def protocol(): # 3 columns for input dataset (shared between parties {1, 2, 3} a = create_column("a", "INTEGER") b = create_column("b", "INTEGER") c = create_column("c", "INTEGER") # create shared input relation rel_one = lang.create("inpt", [a, b, c], {1, 2, 3}) # compute deciles of values in column "a" d = lang.deciles(rel_one, "deciles", [], "a") # reveal output to parties 1, 2, and 3 lang.collect(d, {1, 2, 3}) # return the workflow's root node return {rel_one}