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

the detail please refer the comment of https://issues.apache.org/jira/browse/SPARK-3007
Just realized this function is a variant of the original `open()` method within the same file. This should be a bug in the master branch.

Another issue is that, `SparkHadoopWriter` resides in project `core`, which is an indirect dependency of `sql/hive`. Thus logically, it's not proper to put `open(dynamicPartPath: String)` here.