leesf commented on a change in pull request #4611:
URL: https://github.com/apache/hudi/pull/4611#discussion_r805451853
##########
File path:
hudi-spark-datasource/hudi-spark3/src/main/scala/org/apache/hudi/Spark3DefaultSource.scala
##########
@@ -17,8 +17,30 @@
package org.apache.hudi
+import org.apache.hudi.exception.HoodieException
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.connector.catalog.{Table, TableProvider}
+import org.apache.spark.sql.connector.expressions.Transform
+import org.apache.spark.sql.hudi.catalog.HoodieInternalV2Table
import org.apache.spark.sql.sources.DataSourceRegister
+import org.apache.spark.sql.types.StructType
+import org.apache.spark.sql.util.CaseInsensitiveStringMap
+
+class Spark3DefaultSource extends DefaultSource with DataSourceRegister with
TableProvider {
-class Spark3DefaultSource extends DefaultSource with DataSourceRegister {
override def shortName(): String = "hudi"
+
+ def inferSchema: StructType = new StructType()
+
+ override def inferSchema(options: CaseInsensitiveStringMap): StructType =
inferSchema
+
+ override def getTable(schema: StructType,
+ partitioning: Array[Transform],
+ properties: java.util.Map[String, String]): Table = {
+ val options = new CaseInsensitiveStringMap(properties)
+ val path = options.get("path")
+ if (path == null) throw new HoodieException("path is null")
Review comment:
done
--
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]