Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 03-25-2019 02:47 PM - edited 09-16-2022 07:15 AM
Hi,
I need to retrieve only the last entry in a given partition if there are multiple entries therein
Assume I create an external table partitioned by date:
create external table test_lb (field1 string, field2 string, field3 string)
partitioned by (year string, month string , day string, host string)
row format delimited fields terminated by ','
Then I insert multiple records to same partition. i,e. same year,month,day
insert into test_lb partition (year="2013", month="07", day="28") values ("foo1", "FOO2", "FOO3");
insert into test_lb partition (year="2013", month="07", day="28") values ("foo4", "FOO5", "FOO6");
How do I retrieve just the most recent entry via a query... is there an inbuilt way to get only the latest values
Created 03-25-2019 03:40 PM
Created 03-25-2019 03:40 PM
Created 03-25-2019 07:03 PM
Thanks