drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Omernik <j...@omernik.com>
Subject SQL Line Formating
Date Thu, 08 Dec 2016 15:23:50 GMT
Hey all,

I have a puzzler (I think).

I have a directory with JSON, it's great, it queries well, it's well
formatted.

I created a view on that directory. Added some columns (like a timestamp
version of the EPOCH time field)

When I run a query in SQL Line of the view, I get a well formatted table:

select * from mytable limit 10;

+------------------+---------------------+--------------+-------------------------------------+
|         col1        |          col2          |     col3      |
           col 4                |

Even though the data appears in different sizes, it takes the results and
pads them if it can and makes it look good.

However, when I run select col1, min(col2), count(distinct col3) as
num_col3 from mytable group by col1 order by num_col3 DESC limit 100;

Then all the columns are squished with no padding.

I guess, why does SQL Line output the data from the select * from mytable
limit 100 by sending the result set through something that determine
min/max columns by not for select col1, agg(col2) from mytable group by
col1 order by agg(col2) desc limit 100?

 Also interesting: If I remove the order by, the formatting is much
better... why is this the case?

Thanks

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