drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanjiv Kumar <sanjiv...@gmail.com>
Subject Column Name change in output while using over()
Date Wed, 18 Jan 2017 07:47:48 GMT
Hello
            I am using Apache Drill latest version (1.9) in embedded mode.

My Problem is :- While using over() in my query alias name changes in
output.

SEE EXAMPLE:-
           SELECT CAST(T1.`ID` AS BIGINT) AS `ID`,
 CAST(T1.`GrandTotal` AS BIGINT) AS `GrandTotal`,
 TO_CHAR((CAST(T1.`CreatedOn` AS TIMESTAMP)),
 'MM-dd-yyyy hh:mm:ss a') AS `CreatedOn`,
 count(0) over() AS `ccount`
FROM <pluginName>.<dbName>.<schemaName>.<tableName> AS T1 LIMIT 100
OFFSET 0

If i used this query column name showing like this:-


$0 $1         $2                            w0$o0
1001   2100 10-03-2016 12:00:00 AM                      132
1002  2275           10-03-2016 12:00:00 AM                      132
1003 150                12-05-2016 12:00:00 AM    132
1004   30                11-03-2016 12:00:00 AM                      132
1005  95                10-14-2016 12:00:00 AM                      132
1006 15                10-05-2016 12:00:00 AM                           132


​But If i remove count(0) AS `ccount` from query, then column name showing
fine.

SEE Example:-

ID GrandTotal         CreatedOn
1001   2100 10-03-2016 12:00:00 AM
1002  2275           10-03-2016 12:00:00 AM
1003 150                12-05-2016 12:00:00 AM
1004   30                11-03-2016 12:00:00 AM
1005  95                10-14-2016 12:00:00 AM
1006 15                10-05-2016 12:00:00 AM
​

​What is the problem with over(). ??What i am doing wrong in this query.?
Why my column name not showing ??​


Thanks & Regards.
Sanjiv Kumar.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message