|
3 | 3 | // Reuses the sample dataset and commands from enrich.csv-spec |
4 | 4 | // |
5 | 5 |
|
6 | | -//TODO: this sometimes returns null instead of the looked up value (likely related to the execution order) |
7 | 6 | basicOnTheDataNode |
8 | 7 | required_capability: join_lookup_v5 |
9 | 8 |
|
@@ -102,6 +101,83 @@ emp_no:integer | language_code:integer | language_name:keyword |
102 | 101 | 10003 | 4 | German |
103 | 102 | ; |
104 | 103 |
|
| 104 | +nonUniqueLeftKeyOnTheDataNode |
| 105 | +required_capability: join_lookup_v5 |
| 106 | + |
| 107 | +FROM employees |
| 108 | +| WHERE emp_no <= 10030 |
| 109 | +| EVAL language_code = emp_no % 10 |
| 110 | +| WHERE language_code < 3 |
| 111 | +| LOOKUP JOIN languages_lookup ON language_code |
| 112 | +| SORT emp_no |
| 113 | +| KEEP emp_no, language_code, language_name |
| 114 | +; |
| 115 | + |
| 116 | +emp_no:integer | language_code:integer | language_name:keyword |
| 117 | +10001 |1 | English |
| 118 | +10002 |2 | French |
| 119 | +10010 |0 | null |
| 120 | +10011 |1 | English |
| 121 | +10012 |2 | French |
| 122 | +10020 |0 | null |
| 123 | +10021 |1 | English |
| 124 | +10022 |2 | French |
| 125 | +10030 |0 | null |
| 126 | +; |
| 127 | + |
| 128 | +nonUniqueRightKeyOnTheDataNode |
| 129 | +required_capability: join_lookup_v5 |
| 130 | + |
| 131 | +FROM employees |
| 132 | +| EVAL language_code = emp_no % 10 |
| 133 | +| LOOKUP JOIN languages_lookup_non_unique_key ON language_code |
| 134 | +| WHERE emp_no > 10090 AND emp_no < 10096 |
| 135 | +| SORT emp_no |
| 136 | +| EVAL country = MV_SORT(country) |
| 137 | +| KEEP emp_no, language_code, language_name, country |
| 138 | +; |
| 139 | + |
| 140 | +emp_no:integer | language_code:integer | language_name:keyword | country:keyword |
| 141 | +10091 | 1 | [English, English, English] | [Canada, United Kingdom, United States of America] |
| 142 | +10092 | 2 | [German, German, German] | [Austria, Germany, Switzerland] |
| 143 | +10093 | 3 | null | null |
| 144 | +10094 | 4 | Quenya | null |
| 145 | +10095 | 5 | null | Atlantis |
| 146 | +; |
| 147 | + |
| 148 | +nonUniqueRightKeyOnTheCoordinator |
| 149 | +required_capability: join_lookup_v5 |
| 150 | + |
| 151 | +FROM employees |
| 152 | +| SORT emp_no |
| 153 | +| LIMIT 5 |
| 154 | +| EVAL language_code = emp_no % 10 |
| 155 | +| LOOKUP JOIN languages_lookup_non_unique_key ON language_code |
| 156 | +| EVAL country = MV_SORT(country) |
| 157 | +| KEEP emp_no, language_code, language_name, country |
| 158 | +; |
| 159 | + |
| 160 | +emp_no:integer | language_code:integer | language_name:keyword | country:keyword |
| 161 | +10001 | 1 | [English, English, English] | [Canada, United Kingdom, United States of America] |
| 162 | +10002 | 2 | [German, German, German] | [Austria, Germany, Switzerland] |
| 163 | +10003 | 3 | null | null |
| 164 | +10004 | 4 | Quenya | null |
| 165 | +10005 | 5 | null | Atlantis |
| 166 | +; |
| 167 | + |
| 168 | +nonUniqueRightKeyFromRow |
| 169 | +required_capability: join_lookup_v5 |
| 170 | + |
| 171 | +ROW language_code = 2 |
| 172 | +| LOOKUP JOIN languages_lookup_non_unique_key ON language_code |
| 173 | +| DROP country.keyword |
| 174 | +| EVAL country = MV_SORT(country) |
| 175 | +; |
| 176 | + |
| 177 | +language_code:integer | language_name:keyword | country:keyword |
| 178 | +2 | [German, German, German] | [Austria, Germany, Switzerland] |
| 179 | +; |
| 180 | + |
105 | 181 | lookupIPFromRow |
106 | 182 | required_capability: join_lookup_v5 |
107 | 183 |
|
|
0 commit comments