This is an automated email from the ASF dual-hosted git repository.

pingtimeout pushed a commit to branch benchmarks-ppc
in repository https://gitbox.apache.org/repos/asf/polaris-tools.git

commit 29e04ef818d46613714264aa2c4e0bae5776734e
Author: Pierre Laporte <pie...@pingtimeout.fr>
AuthorDate: Mon Jun 2 18:11:39 2025 +0200

    Update view creation for Dremio Lineage support
---
 .../polaris/benchmarks/actions/ViewActions.scala   | 26 +++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git 
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala
 
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala
index d8bc44c..288d64e 100644
--- 
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala
+++ 
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala
@@ -80,20 +80,36 @@ case class ViewActions(
   def viewCreationFeeder(): Feeder[Any] = viewIdentityFeeder()
     .map { row =>
       val viewId = row("viewId").asInstanceOf[Int]
-      val tableName = s"T_$viewId"
       val viewName = row("viewName").asInstanceOf[String]
       val parentNamespacePath: Seq[String] = 
row("parentNamespacePath").asInstanceOf[Seq[String]]
+
+      val sourceEntityId = if (viewId == 0) {
+        0
+      } else {
+        dp.nAryTree.pathToRoot(viewId).dropRight(1).last
+      }
+      val sourceParentleafNodePosition = sourceEntityId / dp.numViewsPerNs
+      val sourceParentLeafNodeOrdinal: Int =
+        dp.nAryTree.lastLevelOrdinals.take(sourceParentleafNodePosition + 
1).last
+      val sourceParentNamespacePath: Seq[String] = dp.nAryTree
+        .pathToRoot(sourceParentLeafNodeOrdinal)
+        .map(ordinal => s"NS_$ordinal")
+      val sourceEntity = if (viewId == 0) {
+        
s"\\\"${dp.ppcSourceName}\\\".${sourceParentNamespacePath.mkString("\\\"", 
"\\\".\\\"", "\\\"")}.\\\"T_0\\\""
+      } else {
+        
s"\\\"${dp.ppcSourceName}\\\".${sourceParentNamespacePath.mkString("\\\"", 
"\\\".\\\"", "\\\"")}.\\\"V_${sourceEntityId}\\\""
+      }
       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(),
+        "defaultNamespace" -> Json.toJson(parentNamespacePath).toString(),
         "fields" -> fields,
-        "sqlQuery" -> s"SELECT * FROM $tableName",
+        "sqlQuery" -> s"SELECT * FROM $sourceEntity",
         "location" -> 
s"${dp.defaultBaseLocation}/${parentNamespacePath.mkString("/")}/$viewName",
         "initialJsonProperties" -> Json.toJson(properties).toString()
       )
@@ -152,12 +168,12 @@ case class ViewActions(
                          |      "engine-name": "spark",
                          |      "iceberg-version": "Apache Iceberg 1.7.0"
                          |    },
-                         |    "default-namespace": ["#{multipartNamespace}"],
+                         |    "default-namespace": #{defaultNamespace},
                          |    "representations": [
                          |      {
                          |        "type": "sql",
                          |        "sql": "#{sqlQuery}",
-                         |        "dialect": "spark"
+                         |        "dialect": "DremioSQL"
                          |      }
                          |    ]
                          |  },

Reply via email to