Class LookupJoinUtil

    • Method Detail

      • getOrderedLookupKeys

        public static int[] getOrderedLookupKeys​(Collection<Integer> allLookupKeys)
        Gets lookup keys sorted by index in ascending order.
      • isAsyncLookup

        public static boolean isAsyncLookup​(org.apache.calcite.plan.RelOptTable temporalTable,
                                            Collection<Integer> lookupKeys,
                                            org.apache.calcite.rel.hint.RelHint lookupHint,
                                            boolean upsertMaterialize)
        This method determines whether async lookup is enabled according to the given lookup keys with considering lookup RelHint and required upsertMaterialize. Note: it will not create the function instance to avoid potential heavy cost during optimization phase. if required upsertMaterialize is true, will return synchronous lookup function only, otherwise prefers asynchronous lookup function except there's a hint option 'async' = 'false', will raise an error if both candidates not found.
        
         1. if upsertMaterialize == true : return false
        
         2. preferAsync = except there is a hint option 'async' = 'false'
          if (preferAsync) {
            return asyncFound ? true : false
          } else {
            return syncFound ? false : true
          }
         
      • getLookupFunction

        public static UserDefinedFunction getLookupFunction​(org.apache.calcite.plan.RelOptTable temporalTable,
                                                            Collection<Integer> lookupKeys,
                                                            ClassLoader classLoader,
                                                            boolean async,
                                                            ResultRetryStrategy retryStrategy)
        Gets required lookup function (async or sync) from temporal table , will raise an error if specified lookup function instance not found.