MCPcopy Create free account
hub / github.com/datasweet/datatable / TestInnerJoin

Function TestInnerJoin

join_test.go:61–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

59}
60
61func TestInnerJoin(t *testing.T) {
62 customers, orders := sampleForJoin()
63 customers.AddColumn("concat", datatable.String, datatable.Expr("concat(`prenom`, `nom`)"))
64 dt, err := customers.InnerJoin(orders, datatable.On("[Customers].[id]", "[Orders].[user_id]"))
65 assert.NoError(t, err)
66 assert.NotNil(t, dt)
67 checkTable(t, dt,
68 "id", "prenom", "nom", "email", "ville", "concat", "date_achat", "num_facture", "prix_total",
69 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", "AiméeMarechal", time.Date(2013, time.January, 23, 0, 0, 0, 0, time.UTC), "A00103", 203.14,
70 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", "AiméeMarechal", time.Date(2013, time.February, 14, 0, 0, 0, 0, time.UTC), "A00104", 124.00,
71 2, "Esmée", "Lefort", "esmee.lefort@example.com", "Lyon", "EsméeLefort", time.Date(2013, time.February, 17, 0, 0, 0, 0, time.UTC), "A00105", 149.45,
72 3, "Marine", "Prevost", "m.prevost@example.com", "Lille", "MarinePrevost", time.Date(2013, time.February, 21, 0, 0, 0, 0, time.UTC), "A00106", 235.35,
73 )
74}
75
76func TestLeftJoin(t *testing.T) {
77 customers, orders := sampleForJoin()

Callers

nothing calls this directly

Calls 6

ExprFunction · 0.92
OnFunction · 0.92
sampleForJoinFunction · 0.85
checkTableFunction · 0.85
AddColumnMethod · 0.80
InnerJoinMethod · 0.80

Tested by

no test coverage detected