You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "TJ Banghart (Jira)" <ji...@apache.org> on 2023/04/25 21:47:00 UTC

[jira] [Commented] (CALCITE-5549) Appropriately set `DATA_TYPE` and `IS_GENERATEDCOLUMN` metadata values for `MEASURE` types

    [ https://issues.apache.org/jira/browse/CALCITE-5549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17716460#comment-17716460 ] 

TJ Banghart commented on CALCITE-5549:
--------------------------------------

I opened [CALCITE-5676|https://issues.apache.org/jira/browse/CALCITE-5676] as a sub-task since {{DATA_TYPE}} and {{TYPE_NAME}} can be updated without a change to Avatica. {{IS_GENERATED}} will still require an Avatica bump.

> Appropriately set `DATA_TYPE` and `IS_GENERATEDCOLUMN` metadata values for `MEASURE` types
> ------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-5549
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5549
>             Project: Calcite
>          Issue Type: Improvement
>          Components: avatica, core
>            Reporter: TJ Banghart
>            Assignee: TJ Banghart
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {{MEASURE}} types (introduced in [CALCITE-5105|https://issues.apache.org/jira/browse/CALCITE-5105]) currently present themselves as {{java.sql.Types#OTHER}} ({{1111}})([ref|https://docs.oracle.com/javase/8/docs/api/java/sql/Types.html#OTHER]) It would be advantageous to surface the underlying data type of the {{MEASURE}} rather than catch all {{OTHER}} since the underlying data type is returned in result sets. 
> For example a {{MEASURE<INTEGER>}} (a measure of type integer) would appear as {{java.sql.Types#INTEGER}} ({{4}}).
> We should also set the {{IS_GENERATEDCOLUMN}} metadata value with this change. All {{MEASURE}} types would populate the column with {{"YES"}} otherwise {{"NO"}}.
> [Here's|https://github.com/apache/calcite/blob/2dba40e7a0a5651eac5a30d9e0a72f178bd9bff2/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java#L466] where the JDBC type gets set in {{CalciteMetaImpl}}.
> For {{IS_GENERATEDCOLUMN}} we will need a change to the {{MetaColumn}} [constructor in Avatica|https://github.com/apache/calcite-avatica/blob/b57eb7cd31a90d3f46b65c13832b398be5b0dad9/core/src/main/java/org/apache/calcite/avatica/MetaImpl.java#L359-L386] that will allow us to set this value.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)