caican00 commented on code in PR #4403:
URL: https://github.com/apache/gravitino/pull/4403#discussion_r1710825927
##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/iceberg/extensions/IcebergExtendedDataSourceV2Strategy.java:
##########
@@ -81,7 +84,7 @@ public Seq<SparkPlan> apply(LogicalPlan plan) {
} else if (plan instanceof CreateOrReplaceBranch) {
CreateOrReplaceBranch createOrReplaceBranch = (CreateOrReplaceBranch)
plan;
return IcebergCatalogAndIdentifier.buildCatalogAndIdentifier(
- spark, createOrReplaceBranch.table())
+ spark, createOrReplaceBranch.table().toIndexedSeq())
Review Comment:
```
error: apply(LogicalPlan) in IcebergExtendedDataSourceV2Strategy cannot
override apply(LogicalPlan) in GenericStrategy
public Seq<SparkPlan> apply(LogicalPlan plan) {
^
return type scala.collection.Seq<SparkPlan> is not compatible with
scala.collection.immutable.Seq<SparkPlan>
```
**scala2.12:**
`type Seq[+A] = _root_.scala.collection.Seq[A]`
The `type scala.Seq` in scala2.12 represents the `scala.collection.Seq`,
`toIndexedSeq` can change the return type to `scala.collection.immutable.Seq`.
and `scala.collection.immutable.Seq` is a sub `trait` of `scala.collection.Seq`
in scala2.12.
**scala2.13:**
```
@migration("scala.Seq is now scala.collection.immutable.Seq instead of
scala.collection.Seq", "2.13.0")
type Seq[+A] = scala.collection.immutable.Seq[A]
val Seq = scala.collection.immutable.Seq
```
The `type scala.Seq` in scala2.13 represents the
`scala.collection.immutable.Seq`.
and the return type of the `apply` function is `type scala.Seq`, to
compatible with scala2.13, we have to return to
`scala.collection.immutable.Seq` explicitly
--
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]