aokolnychyi commented on code in PR #55278:
URL: https://github.com/apache/spark/pull/55278#discussion_r3164959362
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/V2TableReference.scala:
##########
@@ -79,22 +80,33 @@ private[sql] case class V2TableReference private(
private[sql] object V2TableReference {
case class TableInfo(
+ tableId: Option[String],
columns: Seq[Column],
metadataColumns: Seq[MetadataColumn])
sealed trait Context
+ /** Context for relations that are re-resolved on access of a dataframe temp
view. */
case class TemporaryViewContext(viewName: Seq[String]) extends Context
+ /** Context for relations that are re-resolved through a transaction
catalog. */
+ case object TransactionContext extends Context
def createForTempView(relation: DataSourceV2Relation, viewName:
Seq[String]): V2TableReference = {
create(relation, TemporaryViewContext(viewName))
}
+ // V2TableReference nodes in the transaction context are produced by
+ // UnresolveRelationsInTransaction which unresolves already resolved
relations.
+ def createForTransaction(relation: DataSourceV2Relation): V2TableReference =
{
+ create(relation, TransactionContext)
+ }
+
private def create(relation: DataSourceV2Relation, context: Context):
V2TableReference = {
val ref = V2TableReference(
relation.catalog.get.asTableCatalog,
relation.identifier.get,
relation.options,
TableInfo(
+ tableId = Option(relation.table.id()),
Review Comment:
Minor: Drop `()` for simple getter for `Option(relation.table.id)`?
--
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]