@@ -816,10 +816,6 @@ class HiveDDLSuite
816816 " the created table must be a Hive managed table" )
817817 assert(targetTable.viewText.isEmpty && targetTable.viewOriginalText.isEmpty,
818818 " the view text and original text in the created table must be empty" )
819- // The location of created table should not be empty. Although Spark SQL does not set it,
820- // when creating it, Hive populates it.
821- assert(targetTable.storage.locationUri.nonEmpty,
822- " the location of created table should not be empty" )
823819 assert(targetTable.comment.isEmpty,
824820 " the comment in the created table must be empty" )
825821 assert(targetTable.unsupportedFeatures.isEmpty,
@@ -855,15 +851,11 @@ class HiveDDLSuite
855851 }
856852
857853 if (sourceTable.tableType == CatalogTableType .VIEW ) {
858- // Source table is a temporary/permanent view, which does not have a provider, serde,
859- // inputFormat, and outputFormat. The created target table uses the default data source format
860- assert(targetTable.storage.serde ==
861- Option (" org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe" ))
862- assert(targetTable.storage.inputFormat ==
863- Option (" org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat" ))
864- assert(targetTable.storage.outputFormat ==
865- Option (" org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat" ))
854+ // Source table is a temporary/permanent view, which does not have a provider. The created
855+ // target table uses the default data source format
866856 assert(targetTable.provider == Option (spark.sessionState.conf.defaultDataSourceName))
857+ } else {
858+ assert(targetTable.provider == sourceTable.provider)
867859 }
868860
869861 val sourceTablePath = getTablePath(sourceTable)
0 commit comments