事实表:
Id Year Month countryId Sales
1 1999 1 1 3000
2 1999 2 1 2300
3 2000 3 2 3999
4 2000 4 3 2939
尺寸表:
Id country province
1 US LA
2 US CA
3 US GA
4 EN LN
我像这样使用番石榴表:
Table<Integer, String, Object> table = Tables.newCustomTable(
Maps.<Integer, Map<String, Object>> newLinkedHashMap(),
new Supplier<Map<String, Object>>() {
public Map<String, Object> get() {
return Maps.newLinkedHashMap();
}
});
table.put(1, "Year", 1999);
table.put(1, "Month", 1);
table.put(1, "countyId", 1);
table.put(1, "Sales", 3000);
// ...... etc
table1.put(1, "county", "US");
table1.put(1, "provice", 1999);
// ......
我想实现一个LEFT JOIN
类似的:
1 1999 1 1 3000 US LA
2 1999 2 1 2300 US LA
3 2000 3 2 3999 US CA
4 2000 4 3 2939 EN LN
我应该怎么办?