@@ -224,8 +224,15 @@ trait DescribeDeltaHistorySuiteBase
224
224
val e = intercept[AnalysisException ] {
225
225
sql(s " DESCRIBE HISTORY $viewName" ).collect()
226
226
}
227
- assert(e.getMessage.contains(" spark_catalog.default.delta_view is a view. " +
228
- " 'DESCRIBE HISTORY' expects a table" ))
227
+ // Error message varies slightly between Spark versions because Spark 3.5 still uses
228
+ // QueryCompilationErrors.expectTableNotViewError instead of
229
+ // QueryCompilationErrors.unsupportedViewOperationError
230
+ assert(
231
+ e.getMessage.contains( // 3.5
232
+ " spark_catalog.default.delta_view is a view. 'DESCRIBE HISTORY' expects a table" ) ||
233
+ e.getMessage.contains( // 4.0
234
+ " 'DESCRIBE HISTORY' expects a table but `spark_catalog`.`default`.`delta_view` is a view" )
235
+ )
229
236
}
230
237
}
231
238
@@ -238,7 +245,15 @@ trait DescribeDeltaHistorySuiteBase
238
245
val e = intercept[AnalysisException ] {
239
246
sql(s " DESCRIBE HISTORY $viewName" ).collect()
240
247
}
241
- assert(e.getMessage.contains(" v is a temp view. 'DESCRIBE HISTORY' expects a table" ))
248
+ // Error message varies slightly between Spark versions because Spark 3.5 still uses
249
+ // QueryCompilationErrors.expectTableNotViewError instead of
250
+ // QueryCompilationErrors.unsupportedViewOperationError
251
+ assert(
252
+ e.getMessage.contains( // 3.5
253
+ " v is a temp view. 'DESCRIBE HISTORY' expects a table" ) ||
254
+ e.getMessage.contains( // 4.0
255
+ " 'DESCRIBE HISTORY' expects a table but `v` is a view" )
256
+ )
242
257
}
243
258
}
244
259
0 commit comments