Class MetadataPathUtils

java.lang.Object
org.apache.drill.exec.store.parquet.metadata.MetadataPathUtils

public class MetadataPathUtils extends Object
Util class that contains helper methods for converting paths in the table and directory metadata structures
  • Constructor Details

    • MetadataPathUtils

      public MetadataPathUtils()
  • Method Details

    • convertToAbsolutePaths

      public static List<org.apache.hadoop.fs.Path> convertToAbsolutePaths(List<org.apache.hadoop.fs.Path> paths, String baseDir)
      Helper method that converts a list of relative paths to absolute ones
      Parameters:
      paths - list of relative paths
      baseDir - base parent directory
      Returns:
      list of absolute paths
    • convertToFilesWithAbsolutePaths

      public static List<? extends MetadataBase.ParquetFileMetadata> convertToFilesWithAbsolutePaths(List<? extends MetadataBase.ParquetFileMetadata> files, String baseDir)
      Convert a list of files with relative paths to files with absolute ones
      Parameters:
      files - list of files with relative paths
      baseDir - base parent directory
      Returns:
      list of files with absolute paths
    • createMetadataWithRelativePaths

      public static Metadata_V4.ParquetTableMetadata_v4 createMetadataWithRelativePaths(Metadata_V4.ParquetTableMetadata_v4 tableMetadataWithAbsolutePaths, org.apache.hadoop.fs.Path baseDir)
      Creates a new parquet table metadata from the tableMetadataWithAbsolutePaths parquet table. A new parquet table will contain relative paths for the files and directories.
      Parameters:
      tableMetadataWithAbsolutePaths - parquet table metadata with absolute paths for the files and directories
      baseDir - base parent directory
      Returns:
      parquet table metadata with relative paths for the files and directories
    • relativize

      public static org.apache.hadoop.fs.Path relativize(org.apache.hadoop.fs.Path baseDir, org.apache.hadoop.fs.Path childPath)
      Constructs relative path from child full path and base path. Or return child path if the last one is already relative
      Parameters:
      childPath - full absolute path
      baseDir - base path (the part of the Path, which should be cut off from child path)
      Returns:
      relative path
    • checkForMetadataFile

      public static boolean checkForMetadataFile(String basePath, String table)
      Helper method for checking the metadata file existence
      Parameters:
      basePath - base path containing tables to be checked for metadata files
      table - table name or table path