Skip to content

Commit ca1caa5

Browse files
committed
#739 Fix compilation for Scala 2.11.
1 parent 36aab25 commit ca1caa5

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/peristence/MetastorePersistenceIceberg.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class MetastorePersistenceIceberg(table: CatalogTable,
6060

6161
val writerOptionsWithAdditionalMetadata = writeOptions ++ Map(
6262
s"snapshot-property.$infoDateColumn" -> infoDate.toString,
63-
s"snapshot-property.$batchIdColumn" -> batchId.toString,
63+
s"snapshot-property.$batchIdColumn" -> batchId.toString
6464
)
6565

6666
val tableExists = CatalogUtils.doesTableExist(table)

pramen/core/src/test/scala/za/co/absa/pramen/core/metastore/persistence/MetastorePersistenceIcebergLongSuite.scala

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package za.co.absa.pramen.core.metastore.persistence
1818

1919
import org.apache.hadoop.fs.Path
20+
import org.apache.iceberg.Table
2021
import org.apache.iceberg.hadoop.HadoopTables
2122
import org.scalatest.Assertion
2223
import org.scalatest.wordspec.AnyWordSpec
@@ -89,10 +90,7 @@ class MetastorePersistenceIcebergLongSuite extends AnyWordSpec
8990
assert(partitionColumns.head == "info_date")
9091

9192
// Get all snapshot properties from the Iceberg table
92-
val location = new Path(hadoopTempDir, s"pramen/iceberg_catalog/default/$tableName").toString
93-
val ht = new HadoopTables
94-
val table = ht.load(location)
95-
val snapshotProperties = table.currentSnapshot().summary().asScala
93+
val snapshotProperties = loadIcebergTable(tableName).currentSnapshot().summary().asScala
9694

9795
assert(snapshotProperties("info_date") == infoDate2.toString)
9896
assert(snapshotProperties("pramen_batchid") == "0")
@@ -193,10 +191,13 @@ class MetastorePersistenceIcebergLongSuite extends AnyWordSpec
193191
}
194192
}
195193

196-
def getTablePartitions(tableName: String): Seq[String] = {
194+
def loadIcebergTable(tableName: String): Table = {
197195
val location = new Path(hadoopTempDir, s"pramen/iceberg_catalog/default/$tableName").toString
198-
val ht = new HadoopTables
199-
val table = ht.load(location)
196+
new HadoopTables().load(location)
197+
}
198+
199+
def getTablePartitions(tableName: String): Seq[String] = {
200+
val table = loadIcebergTable(tableName)
200201

201202
table.spec()
202203
.fields()

0 commit comments

Comments
 (0)