Class FormatNameResolver

java.lang.Object
org.elasticsearch.xpack.esql.datasources.FormatNameResolver

public final class FormatNameResolver extends Object
Single source of truth for resolving format names from EXTERNAL query configuration.

Both the optimizer (PushFiltersToSource) and execution (FileSourceFactory) need to resolve which format reader to use for a given query. This class centralises that logic so the two code paths cannot diverge.

Resolution priority:

  1. reader config key — reader alias mapped to format name
  2. format config key: explicit format override (the sentinel FORMAT_AUTO and an empty value mean "no override" and fall through to the extension)
  3. File extension extracted from the source path