[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
The first comparison is redundant.