@Internal public class PartitionLoader extends Object implements Closeable
This provide two interface to load: 1.loadPartition(java.util.LinkedHashMap<java.lang.String, java.lang.String>, java.util.List<org.apache.flink.core.fs.Path>): load temporary partitioned
files, if it is new partition, will create partition to meta store. 2.loadNonPartition(java.util.List<org.apache.flink.core.fs.Path>):
just rename all files to final output path.
TODO: src and dest may be on different FS.
| 构造器和说明 |
|---|
PartitionLoader(boolean overwrite,
org.apache.flink.core.fs.FileSystem sourceFs,
TableMetaStoreFactory factory,
boolean isToLocal,
org.apache.flink.table.catalog.ObjectIdentifier identifier,
List<PartitionCommitPolicy> policies) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
loadEmptyPartition(LinkedHashMap<String,String> partSpec)
The flink job does not write data to the partition, but the corresponding partition needs to
be created or updated.
|
void |
loadNonPartition(List<org.apache.flink.core.fs.Path> srcDirs)
Load a non-partition files to output path.
|
void |
loadPartition(LinkedHashMap<String,String> partSpec,
List<org.apache.flink.core.fs.Path> srcDirs)
Load a single partition.
|
public PartitionLoader(boolean overwrite,
org.apache.flink.core.fs.FileSystem sourceFs,
TableMetaStoreFactory factory,
boolean isToLocal,
org.apache.flink.table.catalog.ObjectIdentifier identifier,
List<PartitionCommitPolicy> policies)
throws Exception
Exceptionpublic void loadPartition(LinkedHashMap<String,String> partSpec, List<org.apache.flink.core.fs.Path> srcDirs) throws Exception
Exceptionpublic void loadNonPartition(List<org.apache.flink.core.fs.Path> srcDirs) throws Exception
Exceptionpublic void loadEmptyPartition(LinkedHashMap<String,String> partSpec) throws Exception
The partition does not exist, create it.
The partition exists:
if overwrite is true, delete the path, then create it;
if overwrite is false, do nothing;
Exceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.