У меня есть проверка имени таблицы в улье, которую выбирает pyspark.
Тестовая таблица
srccountry|dstcountry | date | time
/na | /na | 2019-06-24 | 01:00:00
reserved | reserved |2019-06-24 | 01:00:00
india | us |2019-06-24 | 01:30:00
us | india |2019-06-24 | 01:35:00
india | /na |2019-06-24 | 01:40:00
india | reserved |2019-06-24 | 01:45:00
/na | us |2019-06-24 | 01:50:00
reserved | us |2019-06-24 | 01:59:00
Я хочу вывод, подобный этому
srccountry|dstcountry | date | time | count
india | us |2019-06-24 | 01:30:00 | 1
us | india |2019-06-24 | 01:35:00 | 1
У меня есть запрос типа thie
select srccountry,dstcountry,count(*) as count
from text
where date='2019-06-24'
and time between '01:00:00' and '02:00:00'
and ((srccountry!='reserved' and dstcountry!='reserved')
or (srccountry!='/na' and dstcountry!='/na'))
group by srccountry,dstcountry order by count
Но он возвращаетвсе данные.