You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Rong Rong (JIRA)" <ji...@apache.org> on 2018/08/21 00:19:00 UTC

[jira] [Updated] (CALCITE-2468) Index Out-of-Bound Exception when trying to infer operand type from struct return type

     [ https://issues.apache.org/jira/browse/CALCITE-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rong Rong updated CALCITE-2468:
-------------------------------
    Description: 
IOOBE was thrown when trying to acquire {{SqlOperandTypeInference}} using {{RETURN_TYPE}} at:
https://github.com/apache/calcite/blob/branch-1.17/core/src/main/java/org/apache/calcite/sql/type/InferTypes.java#L68

The follow SQLs demonstrates how to trigger the exception over a simple Schema:

{code:yaml}
- table1:
  - structType1:
    - intField
  - structType2:
    - intField
    - bigintField
{code}

- Exception SQL:
{code:sql}
SELECT structType1 AS myStructType FROM table1
{code}

- Correct SQL:
{code:sql}
SELECT structType1 FROM table1
{code}
{code:sql}
SELECT structType2 AS myStructType FROM table1
{code}

E2E example can be found in:
https://github.com/apache/calcite/commit/d5fb1f9fc5d3f9583128d9ee35c4a23e8470d54d


  was:
IOOBE was thrown when trying to acquire {{SqlOperandTypeInference}} using {{RETURN_TYPE}} at:
https://github.com/apache/calcite/blob/branch-1.17/core/src/main/java/org/apache/calcite/sql/type/InferTypes.java#L68

The follow SQLs demonstrates how to trigger the exception over a simple Schema:

{code:yaml}
- table1:
  - structType1:
    - intField
  - structType2:
    - intField
    - bigintField
{code}

- Exception SQL:
{code:sql}
SELECT structType1 AS myStructType FROM table1
{code}

- Correct SQL:
{code:sql}
SELECT structType1 FROM table1
{code}
{code:sql}
SELECT structType2 AS myStructType FROM table1
{code}

I will pasted an e2e SQL + DDL reproduction test asap.



> Index Out-of-Bound Exception when trying to infer operand type from struct return type
> --------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2468
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2468
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Rong Rong
>            Assignee: Julian Hyde
>            Priority: Major
>
> IOOBE was thrown when trying to acquire {{SqlOperandTypeInference}} using {{RETURN_TYPE}} at:
> https://github.com/apache/calcite/blob/branch-1.17/core/src/main/java/org/apache/calcite/sql/type/InferTypes.java#L68
> The follow SQLs demonstrates how to trigger the exception over a simple Schema:
> {code:yaml}
> - table1:
>   - structType1:
>     - intField
>   - structType2:
>     - intField
>     - bigintField
> {code}
> - Exception SQL:
> {code:sql}
> SELECT structType1 AS myStructType FROM table1
> {code}
> - Correct SQL:
> {code:sql}
> SELECT structType1 FROM table1
> {code}
> {code:sql}
> SELECT structType2 AS myStructType FROM table1
> {code}
> E2E example can be found in:
> https://github.com/apache/calcite/commit/d5fb1f9fc5d3f9583128d9ee35c4a23e8470d54d



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)