[
https://issues.apache.org/jira/browse/CALCITE-3261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16911323#comment-16911323
]
Xiaoguang Zhang commented on CALCITE-3261:
------------------------------------------
Thanks [~danny0405] [~julianhyde] for replaying.
I agree with [~julianhyde] that this is indeed not a incorrect behavior, it's
more of a potential improvement. The issue type is marked as "Improvement" but
the title is misleading, I'll change it later.
I've did more tests and it shows that the column labels are `min(e.empid)` from
both MySQL CLI and JDBC driver. Besides, from a user's perspective, I think
`min(e.empid)` is more friendly. What do you think?
Seems like this is a nice-to-have issue, I would like to give it a try if you
don't mind.
> Incorrect output field names from jdbc
> --------------------------------------
>
> Key: CALCITE-3261
> URL: https://issues.apache.org/jira/browse/CALCITE-3261
> Project: Calcite
> Issue Type: Improvement
> Components: core, jdbc-adapter
> Reporter: Xiaoguang zhang
> Priority: Major
>
> After implementing the missing `print(ResultSet)` method from the examples in
> Calcite [tutorial|[https://calcite.apache.org/docs/index.html]], I found that
> the output field names are incorrect:
> {code:java}
> [deptno, EXPR$1]
> [1, 1]
> [2, 2]
> {code}
> The field name `EXPR$1` can be improved to be more human readable like MySQL
> client:
> {code:java}
> +--------+--------------+
> | deptno | min(e.empid) |
> +--------+--------------+
> | 1 | 1 |
> | 2 | 2 |
> +--------+--------------+
> {code}
>
> PS: the sql statement generating the above outputs:
> {code:sql}
> select d.deptno, min(e.empid) from hr.emps as e join hr.depts as d on
> e.deptno = d.deptno group by d.deptno having count(*) > 1
> {code}
--
This message was sent by Atlassian Jira
(v8.3.2#803003)