Skip to content

Commit 8a9e6bb

Browse files
committed
feat: expose ConverterProvider methods
1 parent fed8cf4 commit 8a9e6bb

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

isthmus/src/main/java/io/substrait/isthmus/ConverterProvider.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public ConverterProvider(
9090
* A {@link SqlParser.Config} is a Calcite class which controls SQL parsing behaviour like
9191
* identifier casing.
9292
*/
93-
protected SqlParser.Config getSqlParserConfig() {
93+
public SqlParser.Config getSqlParserConfig() {
9494
return SqlParser.Config.DEFAULT
9595
.withUnquotedCasing(Casing.TO_UPPER)
9696
.withParserFactory(SqlDdlParserImpl.FACTORY)
@@ -101,15 +101,15 @@ protected SqlParser.Config getSqlParserConfig() {
101101
* A {@link CalciteConnectionConfig} is a Calcite class which controls SQL processing behaviour
102102
* like table name case-sensitivity.
103103
*/
104-
protected CalciteConnectionConfig getCalciteConnectionConfig() {
104+
public CalciteConnectionConfig getCalciteConnectionConfig() {
105105
return CalciteConnectionConfig.DEFAULT.set(CalciteConnectionProperty.CASE_SENSITIVE, "false");
106106
}
107107

108108
/**
109109
* A {@link SqlToRelConverter.Config} is a Calcite class which controls SQL processing behaviour
110110
* like field-trimming.
111111
*/
112-
protected SqlToRelConverter.Config getSqlToRelConverterConfig() {
112+
public SqlToRelConverter.Config getSqlToRelConverterConfig() {
113113
return SqlToRelConverter.config().withTrimUnusedFields(true).withExpand(false);
114114
}
115115

@@ -118,7 +118,7 @@ protected SqlToRelConverter.Config getSqlToRelConverterConfig() {
118118
* org.apache.calcite.sql.SqlOperator}s available and controls valid identifiers during SQL
119119
* processing.
120120
*/
121-
protected SqlOperatorTable getSqlOperatorTable() {
121+
public SqlOperatorTable getSqlOperatorTable() {
122122
return SubstraitOperatorTable.INSTANCE;
123123
}
124124

@@ -128,15 +128,15 @@ protected SqlOperatorTable getSqlOperatorTable() {
128128
* A {@link SubstraitRelVisitor} converts Calcite {@link org.apache.calcite.rel.RelNode}s to
129129
* Substrait {@link Rel}s
130130
*/
131-
protected SubstraitRelVisitor getSubstraitRelVisitor() {
131+
public SubstraitRelVisitor getSubstraitRelVisitor() {
132132
return new SubstraitRelVisitor(this);
133133
}
134134

135135
/**
136136
* A {@link RexExpressionConverter} converts Calcite {@link org.apache.calcite.rex.RexNode}s to
137137
* Substrait equivalents.
138138
*/
139-
protected RexExpressionConverter getRexExpressionConverter(SubstraitRelVisitor srv) {
139+
public RexExpressionConverter getRexExpressionConverter(SubstraitRelVisitor srv) {
140140
return new RexExpressionConverter(
141141
srv, getCallConverters(), getWindowFunctionConverter(), getTypeConverter());
142142
}
@@ -145,7 +145,7 @@ protected RexExpressionConverter getRexExpressionConverter(SubstraitRelVisitor s
145145
* {@link CallConverter}s are used to convert Calcite {@link org.apache.calcite.rex.RexCall}s to
146146
* Substrait equivalents.
147147
*/
148-
protected List<CallConverter> getCallConverters() {
148+
public List<CallConverter> getCallConverters() {
149149
ArrayList<CallConverter> callConverters = new ArrayList<>();
150150
callConverters.add(new FieldSelectionConverter(typeConverter));
151151
callConverters.add(CallConverters.CASE);
@@ -167,7 +167,7 @@ protected List<CallConverter> getCallConverters() {
167167
*
168168
* <p>Override to customize the schema generation behaviour
169169
*/
170-
protected Function<Rel, CalciteSchema> getSchemaResolver() {
170+
public Function<Rel, CalciteSchema> getSchemaResolver() {
171171
SchemaCollector schemaCollector = new SchemaCollector(this);
172172
return schemaCollector::toSchema;
173173
}
@@ -176,15 +176,15 @@ protected Function<Rel, CalciteSchema> getSchemaResolver() {
176176
* A {@link SubstraitRelNodeConverter} is used when converting from Substrait {@link Rel}s to
177177
* Calcite {@link org.apache.calcite.rel.RelNode}s.
178178
*/
179-
protected SubstraitRelNodeConverter getSubstraitRelNodeConverter(RelBuilder relBuilder) {
179+
public SubstraitRelNodeConverter getSubstraitRelNodeConverter(RelBuilder relBuilder) {
180180
return new SubstraitRelNodeConverter(relBuilder, this);
181181
}
182182

183183
/**
184184
* A {@link ExpressionRexConverter} converts Substrait {@link io.substrait.expression.Expression}
185185
* to Calcite equivalents
186186
*/
187-
protected ExpressionRexConverter getExpressionRexConverter(
187+
public ExpressionRexConverter getExpressionRexConverter(
188188
SubstraitRelNodeConverter relNodeConverter) {
189189
ExpressionRexConverter erc =
190190
new ExpressionRexConverter(
@@ -200,7 +200,7 @@ protected ExpressionRexConverter getExpressionRexConverter(
200200
* A {@link RelBuilder} is a Calcite class used as a factory for creating {@link
201201
* org.apache.calcite.rel.RelNode}s.
202202
*/
203-
protected RelBuilder getRelBuilder(CalciteSchema schema) {
203+
public RelBuilder getRelBuilder(CalciteSchema schema) {
204204
return RelBuilder.create(Frameworks.newConfigBuilder().defaultSchema(schema.plus()).build());
205205
}
206206

isthmus/src/main/java/io/substrait/isthmus/DynamicConverterProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public DynamicConverterProvider(
2424
}
2525

2626
@Override
27-
protected List<CallConverter> getCallConverters() {
27+
public List<CallConverter> getCallConverters() {
2828
List<CallConverter> callConverters = super.getCallConverters();
2929

3030
SimpleExtension.ExtensionCollection dynamicExtensionCollection =
@@ -45,7 +45,7 @@ protected List<CallConverter> getCallConverters() {
4545
}
4646

4747
@Override
48-
protected SqlOperatorTable getSqlOperatorTable() {
48+
public SqlOperatorTable getSqlOperatorTable() {
4949
SimpleExtension.ExtensionCollection dynamicExtensionCollection =
5050
ExtensionUtils.getDynamicExtensions(extensions);
5151
if (!dynamicExtensionCollection.scalarFunctions().isEmpty()

0 commit comments

Comments
 (0)