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

Julian Hyde edited comment on CALCITE-6343 at 9/16/24 1:55 AM:
---------------------------------------------------------------

I edited the description, removing the explicit link. Note that CALCITE-5869 
now has strike-through, because the bug is closed.

It seems reasonable that "{{SELECT m AS m}}" should return a measure if {{m}} 
is a measure. But we also need a gesture to convert m into a value; any 
suggestions what that should be? Also, can we agree that "{{SELECT * FROM t}}" 
is equivalent to writing "{{SELECT m, n, o, p FROM t}}", with each of the 
columns remaining measures (or non-measures).

Is this behavior documented anywhere?


was (Author: julianhyde):
I edited the description, removing the explicit link. Note that CALCITE-5689 
now has strike-through, because the bug is closed.

It seems reasonable that "{{SELECT m AS m}}" should return a measure if {{m}} 
is a measure. But we also need a gesture to convert m into a value; any 
suggestions what that should be? Also, can we agree that "{{SELECT * FROM t}}" 
is equivalent to writing "{{SELECT m, n, o, p FROM t}}", with each of the 
columns remaining measures (or non-measures).

Is this behavior documented anywhere?

> AS alias operator strips MEASUREness from measures
> --------------------------------------------------
>
>                 Key: CALCITE-6343
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6343
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.36.0
>            Reporter: Barry Kelly
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.38.0
>
>
> CALCITE-5869 introduced a change which removes MEASURE when inferring the 
> return type when an operator is applied.
> The {{AS}} keyword for aliases is implemented as an operator in the SQL AST. 
> Using {{AS}} removes MEASURE when typing expressions that have an alias in 
> the {{SELECT}} clause.
> Thus, the type of {{SELECT m}} and {{SELECT m AS m}} are different when {{m}} 
> is a measure. This is not desirable.
> Proposed fix: don't change type when using the {{AS}} operator.



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

Reply via email to