Skip to content

Commit

Permalink
fix idea warning of cannot find scala lib, fix code complie error for…
Browse files Browse the repository at this point in the history
… different scala version (#227)

fix #182

Co-authored-by: jinsilei <jinsilei@corp.netease.com>
  • Loading branch information
hellojinsilei and jinsilei committed Aug 25, 2022
1 parent f323487 commit 7aff61e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions spark/v3.1/spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.12</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.apache.spark.sql.execution.datasources.v2.V2CommandExec
import org.apache.spark.sql.types.{MetadataBuilder, StringType, StructField, StructType}

import scala.collection.JavaConverters.mapAsScalaMapConverter
import scala.collection.convert.ImplicitConversions.`collection AsScalaIterable`
import scala.collection.mutable.ArrayBuffer

case class DescribeKeyedTableExec(table: Table,
Expand Down Expand Up @@ -58,7 +59,7 @@ case class DescribeKeyedTableExec(table: Table,
if (!table.primaryKeySpec.primaryKeyExisted()) {
rows += toCatalystRow("Not keyed table", "", "")
} else {
table.primaryKeySpec().primaryKeyStruct().fields().forEach( k => {
table.primaryKeySpec().primaryKeyStruct().fields().toSeq.foreach( k => {
rows += toCatalystRow(k.name(), k.`type`().toString, "")
})
}
Expand Down

0 comments on commit 7aff61e

Please sign in to comment.