Does anybody have any advice on how to automatically create a table partition (via HCatalog) when a directory is done being written to by an HDFS sink?

If not, any suggestions on where to look in the source code for adding such a hook?

Thank you!