I am using
drop table <table_name>
If I recreate the table with the same schema and name, I am getting the old data back. Should I remove the table directory from hdfs file system to completely get rid of the data?
You have to change the external to internal table before drop it:
example
beeline> ALTER TABLE $tablename SET TBLPROPERTIES('EXTERNAL'='False'); // make the table as internal
and then:
beeline> drop table $tablename; //if you drop the table data will be dropped as well.