Class PartitionLoader

    • Method Detail

      • loadPartition

        public void loadPartition​(LinkedHashMap<String,​String> partSpec,
                                  List<Path> srcPaths,
                                  boolean srcPathIsDir)
                           throws Exception
        Load a single partition.
        Parameters:
        partSpec - the specification for the single partition
        srcPaths - the paths for the files used to load to the single partition
        srcPathIsDir - whether the every path in {@param srcPaths} is directory or not. If true, it will load the files under the directory of the every path. If false, every path in {@param srcPaths} is considered as single file, and it will load the single file for every path.
        Throws:
        Exception
      • loadNonPartition

        public void loadNonPartition​(List<Path> srcPaths,
                                     boolean srcPathIsDir)
                              throws Exception
        Load a non-partition files to output path.
        Parameters:
        srcPaths - the paths for the files used to load to the single partition
        srcPathIsDir - whether the every path in {@param srcPaths} is directory or not. If true, it will load the files under the directory of the every path. If false, every path in {@param srcPaths} is considered as single file, and it will load the single file for every path.
        Throws:
        Exception
      • loadEmptyPartition

        public void loadEmptyPartition​(LinkedHashMap<String,​String> partSpec)
                                throws Exception
        The flink job does not write data to the partition, but the corresponding partition needs to be created or updated.

        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;
         
        Throws:
        Exception