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

Function TestInnerJoinWithExprOnHidden

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

Source from the content-addressed store, hash-verified

126}
127
128func TestInnerJoinWithExprOnHidden(t *testing.T) {
129 customers, orders := sampleForJoin()
130 customers.AddColumn("id2", datatable.Int, datatable.Expr("`id`+100"))
131 orders.AddColumn("user_id2", datatable.Int, datatable.Expr("`user_id`+100"))
132 customers.HideColumn("id")
133 dt, err := customers.InnerJoin(orders, datatable.On("[Customers].[id2]", "[Orders].[user_id2]"))
134 assert.NoError(t, err)
135 assert.NotNil(t, dt)
136
137 fmt.Println(dt)
138
139 checkTable(t, dt,
140 "prenom", "nom", "email", "ville", "id2", "user_id", "date_achat", "num_facture", "prix_total",
141 "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,
142 "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,
143 "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,
144 "Marine", "Prevost", "m.prevost@example.com", "Lille", 103, 3, time.Date(2013, time.February, 21, 0, 0, 0, 0, time.UTC), "A00106", 235.35,
145 )
146}
147
148func TestLeftJoinWithExpr(t *testing.T) {
149 customers, orders := sampleForJoin()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected