hive>>
select country, count(1) from txnrecords_part_all_sat group by country;
US 95907
alter table txnrecords_part_all_sat add partition (country='IN');
insert into txnrecords_part_all_sat partition(country='IN') values(14111,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
pyspark>> #No records shown
>>> df33 = spark.sql("select * from test.txnrecords_part_all_sat where country='IN'")
>>> df33.show()
+-----+-------+------+------+--------+-------+----+-----+-------+-------------+-------+
|txnno|txndate|custno|amount|category|product|city|state|spendby|country_check|country|
+-----+-------+------+------+--------+-------+----+-----+-------+-------------+-------+
+-----+-------+------+------+--------+-------+----+-----+-------+-------------+-------+
hive>>
hive>> select country, count(1) from txnrecords_part_all_sat group by country;
IN 1
US 95907
hive> show partitions test.txnrecords_part_all_sat;
country=IN
country=US
pyspark>>
>>> spark.sql('REFRESH TABLE test.txnrecords_part_all_sat')
DataFrame[]
>>> df33 = spark.sql("select * from test.txnrecords_part_all_sat where country='IN'")
>>> df33.show()
+-----+-------+------+------+--------+-------+----+-----+-------+-------------+-------+
|txnno|txndate|custno|amount|category|product|city|state|spendby|country_check|country|
+-----+-------+------+------+--------+-------+----+-----+-------+-------------+-------+
|14111| null| null| null| null| null|null| null| null| null| IN|
+-----+-------+------+------+--------+-------+----+-----+-------+-------------+-------+
No comments:
Post a Comment