You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/docs/connectors/table/elasticsearch.md
+65Lines changed: 65 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -244,6 +244,58 @@ Connector Options
244
244
By default uses built-in <code>'json'</code> format. Please refer to <a href="{{< ref "docs/connectors/table/formats/overview" >}}">JSON Format</a> page for more details.
<td>The cache strategy for the lookup table. Currently supports NONE (no caching) and PARTIAL (caching entries on lookup operation in external database).</td>
254
+
</tr>
255
+
<tr>
256
+
<td><h5>lookup.partial-cache.max-rows</h5></td>
257
+
<td>optional</td>
258
+
<td>yes</td>
259
+
<td style="word-wrap: break-word;">(none)</td>
260
+
<td>Long</td>
261
+
<td>The max number of rows of lookup cache, over this value, the oldest rows will be expired.
262
+
"lookup.cache" must be set to "PARTIAL" to use this option.</td>
<td>Whether to store an empty value into the cache if the lookup key doesn't match any rows in the table.
289
+
"lookup.cache" must be set to "PARTIAL" to use this option.</td>
290
+
</tr>
291
+
<tr>
292
+
<td><h5>lookup.max-retries</h5></td>
293
+
<td>optional</td>
294
+
<td>yes</td>
295
+
<td style="word-wrap: break-word;">3</td>
296
+
<td>Integer</td>
297
+
<td>The max retry times if lookup database failed.</td>
298
+
</tr>
247
299
</tbody>
248
300
</table>
249
301
@@ -280,6 +332,19 @@ When formatting the system time as a string, the time zone configured in the ses
280
332
**NOTE:** When using the dynamic index generated by the current system time, for changelog stream, there is no guarantee that the records with the same primary key can generate the same index name.
281
333
Therefore, the dynamic index based on the system time can only support append only stream.
282
334
335
+
### Lookup Cache
336
+
337
+
Elasticsearch connector can be used in temporal join as a lookup source (aka. dimension table). Currently, only sync lookup mode is supported.
338
+
339
+
By default, lookup cache is not enabled. You can enable it by setting `lookup.cache` to `PARTIAL`.
340
+
341
+
The lookup cache is used to improve performance of temporal join the Elasticsearch connector. By default, lookup cache is not enabled, so all the requests are sent to external database.
342
+
When lookup cache is enabled, each process (i.e. TaskManager) will hold a cache. Flink will lookup the cache first, and only send requests to external database when cache missing, and update cache with the rows returned.
343
+
The oldest rows in cache will be expired when the cache hit to the max cached rows `lookup.partial-cache.max-rows` or when the row exceeds the max time to live specified by `lookup.partial-cache.expire-after-write` or `lookup.partial-cache.expire-after-access`.
344
+
The cached rows might not be the latest, users can tune expiration options to a smaller value to have a better fresh data, but this may increase the number of requests send to database. So this is a balance between throughput and correctness.
345
+
346
+
By default, flink will cache the empty query result for a Primary key, you can toggle the behaviour by setting `lookup.partial-cache.cache-missing-key` to false.
0 commit comments