You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Xiaoguang Zhang (Jira)" <ji...@apache.org> on 2019/08/20 13:15:00 UTC

[jira] [Comment Edited] (CALCITE-3261) Make JDBC output column labels more human readable

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

Xiaoguang Zhang edited comment on CALCITE-3261 at 8/20/19 1:14 PM:
-------------------------------------------------------------------

Thanks [~danny0405], [~julianhyde] for replaying. 

I agree with [~julianhyde]  that this is indeed not an 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. 


was (Author: zhxiaog):
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. 

> Make JDBC output column labels more human readable
> --------------------------------------------------
>
>                 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)