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

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

The Avatica change is very simple: 
https://github.com/apache/calcite-avatica/pull/216 I decided to add the only 
`isAutoincrement` in addition to `isGenerated` since it was the only other 
argument that was non-nullable. Tests were already checked in 
[here|https://github.com/apache/calcite-avatica/blob/92edd93e1977575f1fa3ceb11f03371b959c6660/core/src/test/java/org/apache/calcite/avatica/MetaResultSetTest.java#L227-L261].
 I'm not sure it is worth adding additional tests for this in Avatica since 
Calcite will cover it.

I don't believe the proto needs to change because metadata responses are 
returned as a {{ResultSetResponse}}. The {{ColumnsRequest}} also remains the 
same since it takes a schema, table, and column name pattern.

> 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)

Reply via email to