def viewCreationFeeder()

in benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala [81:98]


  def viewCreationFeeder(): Feeder[Any] = viewIdentityFeeder()
    .map { row =>
      val viewId = row("viewId").asInstanceOf[Int]
      val tableName = s"T_$viewId"
      val fields: Seq[ViewField] = (1 to dp.numColumnsPerView)
        .map(id => ViewField(id = id, name = s"column$id", `type` = "int", required = true))
      val properties: Map[String, String] = (0 until dp.numViewProperties)
        .map(id => s"InitialAttribute_$id" -> s"$id")
        .toMap
      row ++ Map(
        "tableName" -> tableName, // Reference the table at the same index as the view
        "timestamp" -> Instant.now().toEpochMilli.toString,
        "fieldsStr" -> Json.toJson(fields).toString(),
        "fields" -> fields,
        "sqlQuery" -> s"SELECT * FROM $tableName",
        "initialJsonProperties" -> Json.toJson(properties).toString()
      )
    }