forked from delta-io/delta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error messages for unsupported features in Hive (delta-io#9)
This PR makes some minor improvements in the error messages for unsupported features. It also adds the table property `spark.sql.sources.provider` so that a Delta table created by Hive can be read by Spark 3.0.0+ when they share the same metastore.
- Loading branch information
Showing
3 changed files
with
89 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.delta.hive | ||
|
||
import org.apache.hadoop.fs.FileSystem | ||
import org.apache.hadoop.io.{ArrayWritable, NullWritable} | ||
import org.apache.hadoop.mapred.{JobConf, OutputFormat, RecordWriter} | ||
import org.apache.hadoop.util.Progressable | ||
|
||
/** | ||
* This class is not a real implementation. We use it to prevent from writing to a Delta table in | ||
* Hive before we support it. | ||
*/ | ||
class DeltaOutputFormat extends OutputFormat[NullWritable, ArrayWritable] { | ||
|
||
private def writingNotSupported[T](): T = { | ||
throw new UnsupportedOperationException( | ||
"Writing to a Delta table in Hive is not supported. Please use Spark to write.") | ||
} | ||
|
||
override def getRecordWriter( | ||
ignored: FileSystem, | ||
job: JobConf, | ||
name: String, | ||
progress: Progressable): RecordWriter[NullWritable, ArrayWritable] = writingNotSupported() | ||
|
||
override def checkOutputSpecs(ignored: FileSystem, job: JobConf): Unit = writingNotSupported() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters