yikf commented on code in PR #7123:
URL: https://github.com/apache/kyuubi/pull/7123#discussion_r2191565335
##########
extensions/spark/kyuubi-spark-connector-hive/src/main/scala/org/apache/kyuubi/spark/connector/hive/HiveTable.scala:
##########
@@ -77,7 +94,11 @@ case class HiveTable(
}
override def newScanBuilder(options: CaseInsensitiveStringMap): ScanBuilder
= {
- HiveScanBuilder(sparkSession, fileIndex, dataSchema, catalogTable)
+ convertedProvider match {
+ case Some("ORC") if
sparkSession.sessionState.conf.getConf(READ_CONVERT_METASTORE_ORC) =>
Review Comment:
Why not the implementation mechanism of ConvertRelation?
##########
extensions/spark/kyuubi-spark-connector-hive/src/main/scala/org/apache/kyuubi/spark/connector/hive/HiveTable.scala:
##########
@@ -59,6 +62,20 @@ case class HiveTable(
catalogTable.stats.map(_.sizeInBytes.toLong).getOrElse(defaultTableSize))
}
+ lazy val convertedProvider: Option[String] = {
+ val serde =
catalogTable.storage.serde.getOrElse("").toUpperCase(Locale.ROOT)
+ val parquet = serde.contains("PARQUET")
+ val orc = serde.contains("ORC")
+ val provider = catalogTable.provider.map(_.toUpperCase(Locale.ROOT))
+ if (orc || provider.contains("ORC")) {
+ Some("ORC")
+ } else if (parquet || provider.contains("PARQUET")) {
Review Comment:
Could `provider` possibly be parquet? It seems only can be hive
##########
extensions/spark/kyuubi-spark-connector-hive/src/test/scala/org/apache/kyuubi/spark/connector/hive/HiveCatalogSuite.scala:
##########
@@ -355,8 +357,17 @@ class HiveCatalogSuite extends KyuubiHiveTest {
val orcProps: util.Map[String, String] = new util.HashMap[String, String]()
orcProps.put(TableCatalog.PROP_PROVIDER, "orc")
val ot = catalog.createTable(orc_table, schema, Array.empty[Transform],
orcProps)
+
val orcScan = ot.asInstanceOf[HiveTable]
-
.newScanBuilder(CaseInsensitiveStringMap.empty()).build().asInstanceOf[HiveScan]
+
.newScanBuilder(CaseInsensitiveStringMap.empty()).build().asInstanceOf[OrcScan]
assert(orcScan.isSplitable(new Path("empty")))
+
+ withSparkSession(Map(READ_CONVERT_METASTORE_ORC.key -> "false")) {
Review Comment:
+1
--
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]