feat(isthmus): introduce a ConverterProvider builder#1036
Open
nielspardon wants to merge 3 commits into
Open
Conversation
This was referenced Jul 24, 2026
Add ConverterProvider.builder() and a nested Builder that carries a full Calcite SqlParser.Config alongside extensions, typeFactory, the function converters, typeConverter and executionBehavior. getSqlParserConfig() now returns the stored config, and DEFAULT_SQL_PARSER_CONFIG (the isthmus default: DEFAULT + TO_UPPER + SqlDdlParserImpl.FACTORY + LENIENT) is exposed as the recommended base for customization. Make the builder the sole public construction path: a protected ConverterProvider(Builder) is the stable subclassing seam (build() and the delegating public constructors route through it), and all public constructors are @deprecated in favour of builder(). DEFAULT is now builder().build(). The two subclasses, DynamicConverterProvider and AutomaticDynamicFunctionMappingConverterProvider, gain a public (Builder) constructor calling super(builder) and deprecate their positional constructors. Callers, tests and examples are migrated to builder()/DEFAULT.
…nverterProvider processCreateStatementsToCatalog now builds the CalciteCatalogReader with the injected ConverterProvider's type factory (getTypeFactory()) and connection config (getCalciteConnectionConfig()) rather than the hardcoded SubstraitTypeSystem.TYPE_FACTORY / SqlConverterBase.CONNECTION_CONFIG, so a custom provider's type factory and connection config are honored end-to-end. The no-arg overload now delegates to the ConverterProvider overload (with DEFAULT), removing the duplicated reader construction. Behavior is unchanged for the default provider — same type factory and connection config.
nielspardon
force-pushed
the
feat/converterprovider-builder-api
branch
from
July 25, 2026 06:41
b065c1c to
defa554
Compare
…rter Two spots still used TypeConverter.DEFAULT instead of the provider's: - ConverterProvider(Builder) built the scalar/aggregate/window function converters via their 2-arg constructors, which fall back to TypeConverter.DEFAULT, so a TypeConverter set through Builder.typeConverter(...) was ignored by those converters. Pass builder.typeConverter through. - SqlExpressionToSubstrait.toNamedStruct converted column types with TypeConverter.DEFAULT; use the injected provider's getTypeConverter(). Behavior is unchanged for the default provider, whose type converter is TypeConverter.DEFAULT.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
ConverterProvider.builder()and a nestedBuilder— a readable, forward-compatible way toconfigure a
ConverterProvider, most importantly to supply a full CalciteSqlParser.Confignowthat the parsers consume the provider's config (#1035).
ConverterProvider.DEFAULT_SQL_PARSER_CONFIG(
SqlParser.Config.DEFAULT+TO_UPPER+SqlDdlParserImpl.FACTORY+LENIENT) is exposed as thebase for customized configs, e.g.
DEFAULT_SQL_PARSER_CONFIG.withUnquotedCasing(Casing.UNCHANGED).Sole construction path + subclassing seam
All public
ConverterProviderconstructors are@Deprecatedin favour ofbuilder(), andDEFAULTis
builder().build(). Subclassing routes through a newprotected ConverterProvider(Builder)seam— the single place instances are created — so adding a component later touches only the builder and
this constructor, never a subclass
super(...)call.DynamicConverterProviderandAutomaticDynamicFunctionMappingConverterProviderconstruct viasuper(builder).Now that the provider is fully configurable, call sites that still used global defaults are routed
through it: the builder's
typeConverterreaches the scalar/aggregate/window converters, and theCREATE-statement catalog reader uses the provider's type factory and connection config.
Compatibility
Source-compatible — no public API removed, deprecated constructors still delegate to the builder,
and behavior is unchanged for the default provider.
Stack (#983 split, merge bottom-up)
ConverterProviderinto the SQL statement parsers (merged)