I want to for all symbols having avg low price >10 to pipe delimited output file/screen output with column header like below example.
Symbol| Low Price
However, I am unable to select column alias having spaces(Low Price) and print column header. I am able to print like.
Could you please take a look at my query and help?
hive -e “select concat_ws(’|’, Symbol,Lowprice) as output
from (select CAST(symbol1 as STRING) AS Symbol, CAST(lowprice as STRING) AS LowPrice
from (select symbol1, avg(price_low) lowprice
from nyse_hdfs group by symbol1
) A where lowprice > 10
) AS B” > output.txt