fred-db commented on code in PR #38941:
URL: https://github.com/apache/spark/pull/38941#discussion_r1052490206


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/InMemoryBaseTable.scala:
##########
@@ -71,7 +71,7 @@ abstract class InMemoryBaseTable(
 
   // purposely exposes a metadata column that conflicts with a data column in 
some tests
   override val metadataColumns: Array[MetadataColumn] = Array(IndexColumn, 
PartitionKeyColumn)
-  private val metadataColumnNames = metadataColumns.map(_.name).toSet -- 
schema.map(_.name)
+  private lazy val metadataColumnNames = metadataColumns.map(_.name).toSet -- 
schema.map(_.name)

Review Comment:
   This had to change as when a subclass changes the metadataColumns, this 
would otherwise lead to a null pointer exception. I couldn't just define my own 
table class as it seemed to involve a lot of setup to support writes/reads, so 
I decided to just subclass this 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]

Reply via email to