kabhishek4 commented on code in PR #1409:
URL: https://github.com/apache/phoenix/pull/1409#discussion_r2613644688


##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -2223,6 +2223,24 @@ private void dropTable(byte[] tableNameToDelete) throws 
SQLException {
         dropTables(Collections.<byte[]>singletonList(tableNameToDelete));
     }
 
+    @Override
+    public void truncateTable(String schemaName, String tableName, boolean 
isNamespaceMapped) throws SQLException {
+        SQLException sqlE = null;
+        TableName hbaseTableName = 
SchemaUtil.getPhysicalTableName(SchemaUtil.getTableName(schemaName, 
tableName).getBytes(), isNamespaceMapped);
+        try {
+            Admin admin = getAdmin();
+            admin.disableTable(hbaseTableName);
+            admin.truncateTable(hbaseTableName, true);

Review Comment:
   Yes, it waits for the table to get created and enabled. I have added assert 
for the same in the code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to