-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6886 from TouK/catalog-nodedeploymentdata-fix
FlinkTestScenarioRunner: ability to pass NodesDeploymentData + fix for Apache Iceberg Illegal table name error
- Loading branch information
Showing
8 changed files
with
154 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../base-tests/src/test/resources/META-INF/services/org.apache.flink.table.factories.Factory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pl.touk.nussknacker.engine.flink.table.definition.MockableCatalogFactory | ||
pl.touk.nussknacker.engine.flink.table.definition.StubbedCatalogFactory |
30 changes: 0 additions & 30 deletions
30
...test/scala/pl/touk/nussknacker/engine/flink/table/definition/MockableCatalogFactory.scala
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
.../test/scala/pl/touk/nussknacker/engine/flink/table/definition/StubbedCatalogFactory.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package pl.touk.nussknacker.engine.flink.table.definition | ||
|
||
import org.apache.flink.table.api.{DataTypes, Schema} | ||
import org.apache.flink.table.catalog.{Catalog, CatalogTable, GenericInMemoryCatalog, ObjectPath} | ||
import org.apache.flink.table.factories.CatalogFactory | ||
|
||
import scala.jdk.CollectionConverters._ | ||
|
||
class StubbedCatalogFactory extends CatalogFactory { | ||
|
||
override def factoryIdentifier(): String = StubbedCatalogFactory.catalogName | ||
|
||
override def createCatalog(context: CatalogFactory.Context): Catalog = StubbedCatalogFactory.catalog | ||
|
||
} | ||
|
||
object StubbedCatalogFactory { | ||
|
||
val catalogName = "stubbed" | ||
|
||
val sampleBoundedTablePath: ObjectPath = ObjectPath.fromString("default.sample_bounded_table") | ||
|
||
val sampleBoundedTableNumberOfRows: Int = 10 | ||
|
||
val sampleColumnName = "fooColumn" | ||
|
||
private val catalog: GenericInMemoryCatalog = populateCatalog(new GenericInMemoryCatalog(catalogName)) | ||
|
||
private def populateCatalog(inMemoryCatalog: GenericInMemoryCatalog): GenericInMemoryCatalog = { | ||
val sampleBoundedTable = CatalogTable.of( | ||
Schema.newBuilder().column(sampleColumnName, DataTypes.STRING()).build(), | ||
null, | ||
List.empty[String].asJava, | ||
Map( | ||
"connector" -> "datagen", | ||
// to make it bounded | ||
"number-of-rows" -> sampleBoundedTableNumberOfRows.toString | ||
).asJava | ||
) | ||
inMemoryCatalog.createTable(sampleBoundedTablePath, sampleBoundedTable, false) | ||
inMemoryCatalog | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters