Class SimpleSourceMetadata
java.lang.Object
org.elasticsearch.xpack.esql.datasources.spi.SimpleSourceMetadata
- All Implemented Interfaces:
SourceMetadata
Simple immutable implementation of SourceMetadata.
Suitable for use by FormatReader implementations and as a base for
table-based sources that need to pass through opaque metadata.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for SimpleSourceMetadata. -
Constructor Summary
ConstructorsConstructorDescriptionSimpleSourceMetadata(List<Attribute> schema, String sourceType, String location) Creates a SimpleSourceMetadata with required fields only.SimpleSourceMetadata(List<Attribute> schema, String sourceType, String location, SourceStatistics statistics, List<String> partitionColumns) Creates a SimpleSourceMetadata with statistics and partition columns.SimpleSourceMetadata(List<Attribute> schema, String sourceType, String location, SourceStatistics statistics, List<String> partitionColumns, Map<String, Object> sourceMetadata, Map<String, Object> config) Creates a SimpleSourceMetadata with all fields including opaque metadata and config. -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleSourceMetadata.Builderbuilder()Creates a builder for constructing SimpleSourceMetadata instances.config()Returns configuration for operator creation.booleaninthashCode()location()Returns the original path or location of the source.Returns optional partition column names.schema()Returns the resolved schema as ESQL attributes.Returns opaque source-specific metadata.Returns the source type identifier.Returns optional statistics for query planning.toString()
-
Constructor Details
-
SimpleSourceMetadata
Creates a SimpleSourceMetadata with required fields only. -
SimpleSourceMetadata
public SimpleSourceMetadata(List<Attribute> schema, String sourceType, String location, SourceStatistics statistics, List<String> partitionColumns) Creates a SimpleSourceMetadata with statistics and partition columns. -
SimpleSourceMetadata
public SimpleSourceMetadata(List<Attribute> schema, String sourceType, String location, SourceStatistics statistics, List<String> partitionColumns, Map<String, Object> sourceMetadata, Map<String, Object> config) Creates a SimpleSourceMetadata with all fields including opaque metadata and config.
-
-
Method Details
-
schema
Description copied from interface:SourceMetadataReturns the resolved schema as ESQL attributes. The attributes represent the columns available for querying.- Specified by:
schemain interfaceSourceMetadata- Returns:
- list of attributes representing the schema, never null
-
sourceType
Description copied from interface:SourceMetadataReturns the source type identifier. Examples: "parquet", "iceberg", "csv", "delta"- Specified by:
sourceTypein interfaceSourceMetadata- Returns:
- the source type string, never null
-
location
Description copied from interface:SourceMetadataReturns the original path or location of the source. This is the URI or path used to access the data.- Specified by:
locationin interfaceSourceMetadata- Returns:
- the location string, never null
-
statistics
Description copied from interface:SourceMetadataReturns optional statistics for query planning. Statistics can include row counts, column statistics, etc.- Specified by:
statisticsin interfaceSourceMetadata- Returns:
- optional statistics, empty if not available
-
partitionColumns
Description copied from interface:SourceMetadataReturns optional partition column names. For partitioned data sources, this indicates which columns are used for partitioning.- Specified by:
partitionColumnsin interfaceSourceMetadata- Returns:
- optional list of partition column names, empty if not partitioned
-
sourceMetadata
Description copied from interface:SourceMetadataReturns opaque source-specific metadata.This is used by table-based sources (Iceberg, Delta Lake) to pass native schema and other source-specific data through to the operator factory without core needing to understand it.
For example, Iceberg stores its native
Schemaobject here under a well-known key. The Iceberg operator factory retrieves it when creating operators, avoiding the need to re-resolve the table.File-based sources typically return an empty map since the schema is embedded in the file itself.
- Specified by:
sourceMetadatain interfaceSourceMetadata- Returns:
- map of source-specific metadata, never null
-
config
Description copied from interface:SourceMetadataReturns configuration for operator creation.This replaces source-specific configuration classes (like S3Configuration) leaking into core. Configuration is stored as a generic map that the source-specific operator factory interprets.
Common keys include:
- "access_key" - S3 access key
- "secret_key" - S3 secret key
- "endpoint" - S3 endpoint URL
- "region" - AWS region
- Specified by:
configin interfaceSourceMetadata- Returns:
- configuration map, never null
-
equals
-
hashCode
public int hashCode() -
toString
-
builder
Creates a builder for constructing SimpleSourceMetadata instances.
-