cloud-fan commented on a change in pull request #35528:
URL: https://github.com/apache/spark/pull/35528#discussion_r808838366
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala
##########
@@ -198,11 +198,20 @@ case class RelationConversions(
}
private def isConvertible(tableMeta: CatalogTable): Boolean = {
- val serde = tableMeta.storage.serde.getOrElse("").toLowerCase(Locale.ROOT)
+ isConvertible(tableMeta.storage)
+ }
+
+ private def isConvertible(storage: CatalogStorageFormat): Boolean = {
+ val serde = storage.serde.getOrElse("").toLowerCase(Locale.ROOT)
serde.contains("parquet") &&
conf.getConf(HiveUtils.CONVERT_METASTORE_PARQUET) ||
serde.contains("orc") && conf.getConf(HiveUtils.CONVERT_METASTORE_ORC)
}
+ private def convertProvider(storage: CatalogStorageFormat): String = {
+ val serde = storage.serde.getOrElse("").toLowerCase(Locale.ROOT)
+ Some("parquet").filter(serde.contains).getOrElse("orc")
Review comment:
nit:
```
if (serde.contains("parquet")) parquet else orc
```
is much simpler
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]