[SPARK-3007][SQL]Add "Dynamic Partition" support to Spark Sql hive

a new PR base on new master.  changes are the same as https://github.com/apache/spark/pull/1919
Do we really need a thread local number format?  The creation of path names is only used from a single thread and not in the critical path.  I'd just allocate a new one there.