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

vjasani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/phoenix-adapters.git


The following commit(s) were added to refs/heads/main by this push:
     new 7e75c46  Fix index tool usage in test
7e75c46 is described below

commit 7e75c46010047b7f966986739b7dcba08d7909e0
Author: Palash Chauhan <[email protected]>
AuthorDate: Thu Nov 6 16:24:40 2025 -0800

    Fix index tool usage in test
---
 .../src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java   | 10 +++++++---
 .../main/java/org/apache/phoenix/ddb/utils/PhoenixUtils.java   |  5 +++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git 
a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java 
b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java
index f687cdb..f40b909 100644
--- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java
+++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java
@@ -22,6 +22,7 @@ import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.phoenix.ddb.rest.RESTServer;
 import org.apache.phoenix.ddb.utils.IndexBuildingActivator;
+import org.apache.phoenix.ddb.utils.PhoenixUtils;
 import org.apache.phoenix.end2end.ServerMetadataCacheTestImpl;
 import org.apache.phoenix.jdbc.PhoenixDriver;
 import org.apache.phoenix.jdbc.PhoenixTestDriver;
@@ -120,8 +121,8 @@ public class UpdateTable2IT {
 
     @Test(timeout = 120000)
     public void testAsyncIndexCreationAndQuery() throws Exception {
-        final String tableName = "TEST_TABLE";
-        final String indexName = "G_IDX" + tableName;
+        final String tableName = "testTable-123.xyz";
+        final String indexName = "gIdx" + tableName;
 
         CreateTableRequest baseTableRequest = 
                 DDLTestUtils.getCreateTableRequest(tableName, "ForumName", 
ScalarAttributeType.S,
@@ -181,7 +182,10 @@ public class UpdateTable2IT {
             IndexBuildingActivator.activateIndexesForBuilding(connection, 0);
             // run MR tool to build index and set state to ACTIVE
             Configuration conf = new Configuration(utility.getConfiguration());
-            TestUtils.runIndexTool(conf, false, "DDB", tableName, tableName + 
"_" + indexName, null, 0, IndexTool.IndexVerifyType.NONE, 
IndexTool.IndexDisableLoggingType.NONE);
+            TestUtils.runIndexTool(conf, false, "DDB",
+                    PhoenixUtils.getEscapedArgument(tableName),
+                    PhoenixUtils.getEscapedArgument(tableName + "_" + 
indexName),
+                    null, 0, IndexTool.IndexVerifyType.NONE, 
IndexTool.IndexDisableLoggingType.NONE);
         }
 
         // make sure Index is active
diff --git 
a/phoenix-ddb-utils/src/main/java/org/apache/phoenix/ddb/utils/PhoenixUtils.java
 
b/phoenix-ddb-utils/src/main/java/org/apache/phoenix/ddb/utils/PhoenixUtils.java
index da2596d..cb01d22 100644
--- 
a/phoenix-ddb-utils/src/main/java/org/apache/phoenix/ddb/utils/PhoenixUtils.java
+++ 
b/phoenix-ddb-utils/src/main/java/org/apache/phoenix/ddb/utils/PhoenixUtils.java
@@ -41,6 +41,7 @@ public class PhoenixUtils {
     public static final String SCHEMA_NAME = "DDB";
     public static final String SCHEMA_DELIMITER = ".";
     public static final String SCHEMA_NAME_AND_DELIM = SCHEMA_NAME + 
SCHEMA_DELIMITER;
+    public static final String ESCAPE_CHARACTER = "\"";
 
     /**
      * To support same index names for different tables under DDB schema,
@@ -79,6 +80,10 @@ public class PhoenixUtils {
        return tableName;
     }
 
+    public static String getEscapedArgument(String arg) {
+        return ESCAPE_CHARACTER + arg + ESCAPE_CHARACTER;
+    }
+
     /**
      * Check whether the connection url provided has the right format.
      *

Reply via email to