You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "Yikf (via GitHub)" <gi...@apache.org> on 2023/07/06 11:46:40 UTC

[GitHub] [kyuubi] Yikf commented on a diff in pull request #5022: [KSHC] CreateTable should use the correct provider

Yikf commented on code in PR #5022:
URL: https://github.com/apache/kyuubi/pull/5022#discussion_r1254322574


##########
extensions/spark/kyuubi-spark-connector-hive/src/main/scala/org/apache/kyuubi/spark/connector/hive/HiveTableCatalog.scala:
##########
@@ -410,6 +416,61 @@ private object HiveTableCatalog {
         Seq(SupportsNamespaces.PROP_COMMENT, SupportsNamespaces.PROP_LOCATION))
   }
 
+  private def getStorageFormatAndProvider(
+      provider: Option[String],
+      maybeStoredAs: Option[String],
+      location: Option[String],
+      options: Map[String, String]): (CatalogStorageFormat, String) = {
+    val nonHiveStorageFormat = CatalogStorageFormat.empty.copy(
+      locationUri = location.map(CatalogUtils.stringToURI),
+      properties = options)
+
+    val conf = SQLConf.get
+    val defaultHiveStorage = HiveSerDe.getDefaultStorage(conf).copy(
+      locationUri = location.map(CatalogUtils.stringToURI),
+      properties = options)
+
+    if (provider.isDefined) {
+      (nonHiveStorageFormat, provider.get)
+    } else if (maybeStoredAs.isDefined) {
+      val maybeSerde = options.get("hive.serde")
+      val maybeInputFormat = options.get("hive.input-format")
+      val maybeOutputFormat = options.get("hive.output-format")
+      val storageFormat = if (maybeStoredAs.isDefined) {

Review Comment:
   Yes, the first check should be serde instead of storedAs, updated.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org