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

stoty pushed a commit to branch 5.1
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.1 by this push:
     new f004232868 PHOENIX-7516 TableNotFoundException thrown when not specify 
schema in CsvBulkloadTool (#2063)
f004232868 is described below

commit f0042328687580081e2d3faa5b762b93a6c66601
Author: chaijunjie0101 <[email protected]>
AuthorDate: Tue Feb 4 22:43:28 2025 +0800

    PHOENIX-7516 TableNotFoundException thrown when not specify schema in 
CsvBulkloadTool (#2063)
---
 .../java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java
index e0c01f2c0f..fc33773479 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java
@@ -238,16 +238,15 @@ public abstract class AbstractBulkLoadTool extends 
Configured implements Tool {
             boolean ignoreInvalidRows = 
cmdLine.hasOption(IGNORE_ERRORS_OPT.getOpt());
             
conf.setBoolean(FormatToBytesWritableMapper.IGNORE_INVALID_ROW_CONFKEY,
                 ignoreInvalidRows);
-            conf.set(FormatToBytesWritableMapper.TABLE_NAME_CONFKEY,
-                SchemaUtil.getEscapedFullTableName(qualifiedTableName));
+            String tbn = 
SchemaUtil.getEscapedFullTableName(qualifiedTableName);
+            conf.set(FormatToBytesWritableMapper.TABLE_NAME_CONFKEY, tbn);
             // give subclasses their hook
             configureOptions(cmdLine, importColumns, conf);
             String sName = SchemaUtil.normalizeIdentifier(schemaName);
             String tName = SchemaUtil.normalizeIdentifier(tableName);
 
-            String tn = SchemaUtil.getEscapedTableName(sName, tName);
             ResultSet rsempty =
-                    conn.createStatement().executeQuery("SELECT * FROM " + tn 
+ " LIMIT 1");
+                    conn.createStatement().executeQuery("SELECT * FROM " + tbn 
+ " LIMIT 1");
             boolean tableNotEmpty = rsempty.next();
             rsempty.close();
 

Reply via email to