TJ Banghart created CALCITE-5549:
------------------------------------
Summary: 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
{{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)