You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Brandon <et...@gmail.com> on 2017/11/04 12:12:31 UTC

Formatting results

Is it possible to format query results, like printf. For example, I have 
a query:

select yr, sum(amount) from table group by year;


Amount is a float, but I'd like to apply a currency format to get 
$123,456.89 instead of 1.23456789E6. Does Drill have a format function?


Thanks.


Brandon


RE: Formatting results

Posted by Kunal Khatua <kk...@mapr.com>.
This should do it:
https://drill.apache.org/docs/data-type-conversion/#to_char-syntax


-----Original Message-----
From: Brandon [mailto:etuini@gmail.com] 
Sent: Saturday, November 04, 2017 5:13 AM
To: user@drill.apache.org
Subject: Formatting results

Is it possible to format query results, like printf. For example, I have a query:

select yr, sum(amount) from table group by year;


Amount is a float, but I'd like to apply a currency format to get
$123,456.89 instead of 1.23456789E6. Does Drill have a format function?


Thanks.


Brandon