[
https://issues.apache.org/jira/browse/CALCITE-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated CALCITE-4696:
------------------------------------
Labels: pull-request-available (was: )
> The method of EnumerableTableScan.fieldExpression throw NullPointerException
> ----------------------------------------------------------------------------
>
> Key: CALCITE-4696
> URL: https://issues.apache.org/jira/browse/CALCITE-4696
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Ning Sheng
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> test sql
> {code:java}
> select d.deptno, min(e.empid) from hr.emps as e join hr.depts as d on
> e.deptno = d.deptno group by d.deptno having count(*) > 1
> {code}
> when dept has list element.
> {code:java}
> public static class Department {
> public final int deptno;
> public final String name;
> public final List<Employee> employees;
> }
> {code}
> It throw NullException in EnumerableTableScan.java because relFieldType is
> JavaType of java.util.List.
> {code:java}
> private Expression fieldExpression(ParameterExpression row_, int i, PhysType
> physType, JavaRowFormat format) {
> final Expression e = format.field(row_, i, null,
> physType.getJavaFieldType(i));
> final RelDataType relFieldType =
> physType.getRowType().getFieldList().get(i).getType();
> switch (relFieldType.getSqlTypeName()) {
> case ARRAY:
> case MULTISET:
> final RelDataType fieldType = relFieldType.getComponentType();
> if (fieldType != null && fieldType.isStruct()) {
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)