cloud-fan commented on code in PR #41348:
URL: https://github.com/apache/spark/pull/41348#discussion_r1221284308
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala:
##########
@@ -194,12 +203,28 @@ class V2SessionCatalog(catalog: SessionCatalog)
}
override def dropTable(ident: Identifier): Boolean = {
+ dropTableInternal(ident)
+ }
+
+ private def dropTableInternal(ident: Identifier, purge: Boolean = false):
Boolean = {
try {
- if (loadTable(ident) != null) {
+ val table = loadTable(ident)
+ if (table != null) {
+ val v1Table = table.asInstanceOf[V1Table].v1Table
Review Comment:
people can provide a custom v2 session and `loadTable` does not always
return a v1 table. Can we do a pattern match here and only do the additional
handling if it's a v1 table?
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala:
##########
@@ -194,12 +203,28 @@ class V2SessionCatalog(catalog: SessionCatalog)
}
override def dropTable(ident: Identifier): Boolean = {
+ dropTableInternal(ident)
+ }
+
+ private def dropTableInternal(ident: Identifier, purge: Boolean = false):
Boolean = {
try {
- if (loadTable(ident) != null) {
+ val table = loadTable(ident)
+ if (table != null) {
+ val v1Table = table.asInstanceOf[V1Table].v1Table
Review Comment:
people can provide a custom v2 session catalog and `loadTable` does not
always return a v1 table. Can we do a pattern match here and only do the
additional handling if it's a v1 table?
--
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]