Source:
private List<HiveTablePartition> initAllPartitions() { List<HiveTablePartition> allHivePartitions = new ArrayList<>(); try (HiveMetastoreClientWrapper client = HiveMetastoreClientFactory.create(new HiveConf(jobConf, HiveConf.class), hiveVersion)) { String dbName = tablePath.getDatabaseName(); String tableName = tablePath.getObjectName(); List<String> partitionColNames = catalogTable.getPartitionKeys(); Table hiveTable = client.getTable(dbName, tableName); Properties tableProps = HiveReflectionUtils.getTableMetadata(hiveShim, hiveTable); String ttlStr = tableProps.getProperty(FileSystemOptions.LOOKUP_JOIN_CACHE_TTL.key()); Configuration configuration = new Configuration(); if (ttlStr != null) { configuration.setString(FileSystemOptions.LOOKUP_JOIN_CACHE_TTL.key(), ttlStr); } hiveTableCacheTTL = configuration.get(FileSystemOptions.LOOKUP_JOIN_CACHE_TTL); if (partitionColNames != null && partitionColNames.size() > 0) { final String defaultPartitionName = jobConf.get(HiveConf.ConfVars.DEFAULTPARTITIONNAME.varname, HiveConf.ConfVars.DEFAULTPARTITIONNAME.defaultStrVal); List<Partition> partitions = new ArrayList<>(); if (remainingPartitions != null) { for (Map<String, String> spec : remainingPartitions) { partitions.add(client.getPartition(dbName, tableName, partitionSpecToValues(spec, partitionColNames))); } } else { partitions.addAll(client.listPartitions(dbName, tableName, (short) -1)); } for (Partition partition : partitions) { HiveTablePartition hiveTablePartition = toHiveTablePartition( catalogTable.getPartitionKeys(), catalogTable.getSchema().getFieldNames(), catalogTable.getSchema().getFieldDataTypes(), hiveShim, tableProps, defaultPartitionName, partition); allHivePartitions.add(hiveTablePartition); } } else { allHivePartitions.add(new HiveTablePartition(hiveTable.getSd(), tableProps)); } } catch (TException e) { throw new FlinkHiveException("Failed to collect all partitions from hive metaStore", e); } return allHivePartitions; }

Target:
private List<HiveTablePartition> initAllPartitions() { List<HiveTablePartition> allHivePartitions = new ArrayList<>(); try (HiveMetastoreClientWrapper client = HiveMetastoreClientFactory.create(new HiveConf(jobConf, HiveConf.class), hiveVersion)) { String dbName = tablePath.getDatabaseName(); String tableName = tablePath.getObjectName(); List<String> partitionColNames = catalogTable.getPartitionKeys(); Table hiveTable = client.getTable(dbName, tableName); Properties tableProps = HiveReflectionUtils.getTableMetadata(hiveShim, hiveTable); String ttlStr = tableProps.getProperty(FileSystemOptions.LOOKUP_JOIN_CACHE_TTL.key()); hiveTableCacheTTL = ttlStr != null ? TimeUtils.parseDuration(ttlStr) : FileSystemOptions.LOOKUP_JOIN_CACHE_TTL.defaultValue(); if (partitionColNames != null && partitionColNames.size() > 0) { final String defaultPartitionName = jobConf.get(HiveConf.ConfVars.DEFAULTPARTITIONNAME.varname, HiveConf.ConfVars.DEFAULTPARTITIONNAME.defaultStrVal); List<Partition> partitions = new ArrayList<>(); if (remainingPartitions != null) { for (Map<String, String> spec : remainingPartitions) { partitions.add(client.getPartition(dbName, tableName, partitionSpecToValues(spec, partitionColNames))); } } else { partitions.addAll(client.listPartitions(dbName, tableName, (short) -1)); } for (Partition partition : partitions) { HiveTablePartition hiveTablePartition = toHiveTablePartition( catalogTable.getPartitionKeys(), catalogTable.getSchema().getFieldNames(), catalogTable.getSchema().getFieldDataTypes(), hiveShim, tableProps, defaultPartitionName, partition); allHivePartitions.add(hiveTablePartition); } } else { allHivePartitions.add(new HiveTablePartition(hiveTable.getSd(), tableProps)); } } catch (TException e) { throw new FlinkHiveException("Failed to collect all partitions from hive metaStore", e); } return allHivePartitions; }