lincoln-lil commented on code in PR #940:
URL: https://github.com/apache/incubator-paimon/pull/940#discussion_r1226178997


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkConnectorOptions.java:
##########
@@ -181,6 +181,12 @@ public class FlinkConnectorOptions {
                             "How many splits should assign to subtask per 
batch in StaticFileStoreSplitEnumerator "
                                     + "to avoid exceed `akka.framesize` 
limit.");
 
+    public static final ConfigOption<Boolean> LOOKUP_ASYNC =

Review Comment:
   @Myasuka I see your confusion. With the current table interfaces, the 
connector itself needs to provide a `LookupRuntimeProvider` that is both an 
`AsyncLookupRuntimeProvider` and a `LookupFunctionProvider` to achieve this 
goal, like this sample code:
   ```java
   /** A full capability lookup table source. */
   public static class MixedLookupTableSource implements LookupTableSource {
   
           @Override
           public LookupRuntimeProvider getLookupRuntimeProvider(LookupContext 
context) {
               AsyncLookupFunction asyncLookupFunction = new 
MyAsyncLookupFunction...
               LookupFunction lookupFunction = new MyLookupFunction...
               return MixedLookupFunctionProvider.of(asyncLookupFunction, 
lookupFunction);
           }
   
           interface MixedLookupFunctionProvider
                   extends AsyncLookupFunctionProvider, LookupFunctionProvider {
               static MixedLookupFunctionProvider of(AsyncLookupFunction 
asyncLookupFunction, LookupFunction lookupFunction) {
                   return new MixedLookupFunctionProvider() {
                       @Override
                       public AsyncLookupFunction createAsyncLookupFunction() {
                           return asyncLookupFunction;
                       }
   
                       @Override
                       public LookupFunction createLookupFunction() {
                           return lookupFunction;
                       }
                   };
               }
           }
   ```
   Yes, for now it looks like this part of the code might be easier for the 
connector developer if the planner can figure out how to handle it, such as 
adding a boolean preferAsync() to the `LookupContext`, which would also save 
the overhead of creating a new function, I'll track this in flink.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to