Class GlobExpander
java.lang.Object
org.elasticsearch.xpack.esql.datasources.glob.GlobExpander
Expands glob patterns and comma-separated path lists into resolved
FileList instances.
Delegates to StorageProvider.listObjects(org.elasticsearch.xpack.esql.datasources.spi.StoragePath, boolean) for directory listing and uses GlobMatcher
for filtering results against the glob pattern.
Supports partition-aware glob rewriting when filter hints are provided.-
Method Summary
Modifier and TypeMethodDescriptionstatic FileListCompresses a raw file list into a compact representation (dictionary or Hive-partitioned).static FileListexpandAndCompact(String path, StorageProvider provider, List<PartitionFilterHintExtractor.PartitionFilterHint> hints, boolean hivePartitioning, StoragePath storagePath) Expands a glob/comma pattern and compresses the result into a compact representation (DictionaryFileList or HiveFileList).static FileListexpandCommaSeparated(String pathList, StorageProvider provider) static FileListexpandCommaSeparated(String pathList, StorageProvider provider, List<PartitionFilterHintExtractor.PartitionFilterHint> hints, boolean hivePartitioning) static FileListexpandGlob(String pattern, StorageProvider provider) static FileListexpandGlob(String pattern, StorageProvider provider, List<PartitionFilterHintExtractor.PartitionFilterHint> hints, boolean hivePartitioning) static FileListexpandGlob(String pattern, StorageProvider provider, List<PartitionFilterHintExtractor.PartitionFilterHint> hints, boolean hivePartitioning, PartitionConfig partitionConfig, Map<String, Object> config) static FileListfileListOf(List<StorageEntry> entries, String pattern) Creates a file list from raw entries.static FileListfileListOf(List<StorageEntry> entries, String pattern, PartitionMetadata partitionMetadata) Creates a file list from raw entries with partition metadata.static booleanisMultiFile(String path) static PartitionDetectorresolveDetector(PartitionConfig config) static StringrewriteGlobWithHints(String pattern, List<PartitionFilterHintExtractor.PartitionFilterHint> hints) static StringrewriteGlobWithHints(String pattern, List<PartitionFilterHintExtractor.PartitionFilterHint> hints, PartitionConfig partitionConfig) static StringrewriteGlobWithTemplate(String pattern, Map<String, PartitionFilterHintExtractor.PartitionFilterHint> rewritableHints, String template) static FileListwithSchemaInfo(FileList fileList, Map<StoragePath, SchemaReconciliation.FileSchemaInfo> schemaInfo) Returns a copy of the file list with per-file schema reconciliation info attached.
-
Method Details
-
fileListOf
Creates a file list from raw entries. Primarily for tests. -
fileListOf
public static FileList fileListOf(List<StorageEntry> entries, String pattern, @Nullable PartitionMetadata partitionMetadata) Creates a file list from raw entries with partition metadata. Primarily for tests. -
compact
Compresses a raw file list into a compact representation (dictionary or Hive-partitioned). -
withSchemaInfo
public static FileList withSchemaInfo(FileList fileList, Map<StoragePath, SchemaReconciliation.FileSchemaInfo> schemaInfo) Returns a copy of the file list with per-file schema reconciliation info attached. -
expandAndCompact
public static FileList expandAndCompact(String path, StorageProvider provider, @Nullable List<PartitionFilterHintExtractor.PartitionFilterHint> hints, boolean hivePartitioning, StoragePath storagePath) throws IOException Expands a glob/comma pattern and compresses the result into a compact representation (DictionaryFileList or HiveFileList). This is the primary entry point for the resolver.- Throws:
IOException
-
resolveDetector
-
isMultiFile
-
expandGlob
- Throws:
IOException
-
expandGlob
public static FileList expandGlob(String pattern, StorageProvider provider, @Nullable List<PartitionFilterHintExtractor.PartitionFilterHint> hints, boolean hivePartitioning, @Nullable PartitionConfig partitionConfig, @Nullable Map<String, Object> config) throws IOException- Throws:
IOException
-
expandGlob
public static FileList expandGlob(String pattern, StorageProvider provider, @Nullable List<PartitionFilterHintExtractor.PartitionFilterHint> hints, boolean hivePartitioning) throws IOException - Throws:
IOException
-
expandCommaSeparated
public static FileList expandCommaSeparated(String pathList, StorageProvider provider) throws IOException - Throws:
IOException
-
expandCommaSeparated
public static FileList expandCommaSeparated(String pathList, StorageProvider provider, @Nullable List<PartitionFilterHintExtractor.PartitionFilterHint> hints, boolean hivePartitioning) throws IOException - Throws:
IOException
-
rewriteGlobWithHints
public static String rewriteGlobWithHints(String pattern, List<PartitionFilterHintExtractor.PartitionFilterHint> hints) -
rewriteGlobWithHints
public static String rewriteGlobWithHints(String pattern, List<PartitionFilterHintExtractor.PartitionFilterHint> hints, @Nullable PartitionConfig partitionConfig) -
rewriteGlobWithTemplate
-