[
https://issues.apache.org/jira/browse/CALCITE-6361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17839121#comment-17839121
]
Mihai Budiu commented on CALCITE-6361:
--------------------------------------
I have managed to create a small reproduction for this. One has to use
ServerTest:
{code:java}
/** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-6361">[CALCITE-6361]
* Uncollect.deriveUncollectRowType crashes if the input data is not a
collection</a>. */
@Test void testUnnest() throws SQLException {
try (Connection c = connect();
Statement s = c.createStatement()) {
boolean b = s.execute("CREATE TYPE simple AS (s INT, t BOOLEAN)");
assertThat(b, is(false));
b = s.execute("CREATE TYPE vec AS (fields SIMPLE ARRAY)");
assertThat(b, is(false));
b = s.execute(" CREATE TABLE T(col vec)");
assertThat(b, is(false));
s.executeQuery("SELECT A.* FROM (T CROSS JOIN UNNEST(T.col) A)");
}
}
{code}
> Uncollect.deriveUncollectRowType crashes if the input data is not a collection
> ------------------------------------------------------------------------------
>
> Key: CALCITE-6361
> URL: https://issues.apache.org/jira/browse/CALCITE-6361
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.37.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> This happens because the type checker calls getComponentType() without
> checking first that the field type has components. It should report an error
> in such a case.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)