17
17
18
18
package org .apache .spark .sql .pipelines .graph
19
19
20
- import org .apache .spark .SparkException
21
- import org .apache .spark .internal .Logging
22
20
import org .apache .spark .sql .AnalysisException
23
21
import org .apache .spark .sql .catalyst .TableIdentifier
24
22
@@ -39,12 +37,10 @@ case class UnresolvedDatasetException(identifier: TableIdentifier)
39
37
* @param name The name of the table
40
38
* @param cause The cause of the failure
41
39
*/
42
- case class LoadTableException (name : String , cause : Option [Throwable ])
43
- extends SparkException (
44
- errorClass = " INTERNAL_ERROR" ,
45
- messageParameters = Map (" message" -> s " Failed to load table ' $name' " ),
46
- cause = cause.orNull
47
- )
40
+ case class LoadTableException (name : String , override val cause : Option [Throwable ])
41
+ extends AnalysisException (s " Failed to load table ' $name' " , cause = cause)
42
+
43
+
48
44
49
45
/**
50
46
* Exception raised when a pipeline has one or more flows that cannot be resolved
@@ -79,13 +75,6 @@ case class UnresolvedPipelineException(
79
75
|failures that precede this log. """ .stripMargin
80
76
)
81
77
82
- /** A validation error that can either be thrown as an exception or logged as a warning. */
83
- trait GraphValidationWarning extends Logging {
84
-
85
- /** The exception to throw when this validation fails. */
86
- protected def exception : AnalysisException
87
- }
88
-
89
78
/**
90
79
* Raised when there's a circular dependency in the current pipeline. That is, a downstream
91
80
* table is referenced while creating a upstream table.
@@ -99,37 +88,3 @@ case class CircularDependencyException(
99
88
s " Circular dependencies are not supported in a pipeline. Please remove the dependency " +
100
89
s " between ' ${upstreamDataset.unquotedString}' and ' ${downstreamTable.unquotedString}'. "
101
90
)
102
-
103
- /**
104
- * Raised when some tables in the current pipeline are not resettable due to some non-resettable
105
- * downstream dependencies.
106
- */
107
- case class InvalidResettableDependencyException (originName : String , tables : Seq [Table ])
108
- extends GraphValidationWarning {
109
- override def exception : AnalysisException = new AnalysisException (
110
- " INVALID_RESETTABLE_DEPENDENCY" ,
111
- Map (
112
- " downstreamTable" -> originName,
113
- " upstreamResettableTables" -> tables
114
- .map(_.displayName)
115
- .sorted
116
- .map(t => s " ' $t' " )
117
- .mkString(" , " ),
118
- " resetAllowedKey" -> PipelinesTableProperties .resetAllowed.key
119
- )
120
- )
121
- }
122
-
123
- /**
124
- * Warn if the append once flows was declared from batch query if there was a run before.
125
- * Throw an exception if not.
126
- * @param table the streaming destination that contains Append Once flows declared with batch query.
127
- * @param flows the append once flows that are declared with batch query.
128
- */
129
- case class AppendOnceFlowCreatedFromBatchQueryException (table : Table , flows : Seq [TableIdentifier ])
130
- extends GraphValidationWarning {
131
- override def exception : AnalysisException = new AnalysisException (
132
- " APPEND_ONCE_FROM_BATCH_QUERY" ,
133
- Map (" table" -> table.displayName)
134
- )
135
- }
0 commit comments