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

Function TestRightJoinWithExpr

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

Source from the content-addressed store, hash-verified

166}
167
168func TestRightJoinWithExpr(t *testing.T) {
169 customers, orders := sampleForJoin()
170 customers.AddColumn("id2", datatable.Int, datatable.Expr("`id`+100"))
171 orders.AddColumn("user_id2", datatable.Int, datatable.Expr("`user_id`+100"))
172 dt, err := customers.RightJoin(orders, datatable.On("[Customers].[id2]", "[Orders].[user_id2]"))
173 assert.NoError(t, err)
174 assert.NotNil(t, dt)
175
176 fmt.Println(dt)
177
178 checkTable(t, dt,
179 "id", "prenom", "nom", "email", "ville", "id2", "user_id", "date_achat", "num_facture", "prix_total",
180 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", 101, 1, time.Date(2013, time.January, 23, 0, 0, 0, 0, time.UTC), "A00103", 203.14,
181 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", 101, 1, time.Date(2013, time.February, 14, 0, 0, 0, 0, time.UTC), "A00104", 124.00,
182 2, "Esmée", "Lefort", "esmee.lefort@example.com", "Lyon", 102, 2, time.Date(2013, time.February, 17, 0, 0, 0, 0, time.UTC), "A00105", 149.45,
183 3, "Marine", "Prevost", "m.prevost@example.com", "Lille", 103, 3, time.Date(2013, time.February, 21, 0, 0, 0, 0, time.UTC), "A00106", 235.35,
184 nil, nil, nil, nil, nil, nil, 5, time.Date(2013, time.March, 2, 0, 0, 0, 0, time.UTC), "A00107", 47.58,
185 )
186}
187
188func TestJoinWithColumnName(t *testing.T) {
189 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
RightJoinMethod · 0.80

Tested by

no test coverage detected