[
https://issues.apache.org/jira/browse/CALCITE-4655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17365325#comment-17365325
]
Ulrich Kramer commented on CALCITE-4655:
----------------------------------------
No I have no unit test for this. It should be reproducible quite easy with the
following pseudo code:
{code:java}
var rootSchema = CalciteSchema.createRootSchema(false).plus();
var jdbcSchema = JdbcSchema.create(rootSchema, "test", dataSource,
SqlDialectFactoryImpl.INSTANCE, catalog, schema);
jdbcSchema.getTable("test").scan(datacontext);
{code}
> NullPointerException in JdbcTable.scan
> --------------------------------------
>
> Key: CALCITE-4655
> URL: https://issues.apache.org/jira/browse/CALCITE-4655
> Project: Calcite
> Issue Type: Improvement
> Affects Versions: 1.26.0, 1.27.0
> Reporter: Ulrich Kramer
> Priority: Major
>
> Calling {{JdbcTable.scan}} will result in a {{NullPointerException}} because
> inside {{JdbcTable.fieldClasses}} {{protoRowType}} is null.
> This could easily be fixed by replacing
> {code:java}
> final RelDataType rowType = requireNonNull(protoRowType,
> "protoRowType").apply(typeFactory);
> {code}
> with
> {code:java}
> final RelDataType rowType = getRowType(typeFactory);
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)