From c9c5ba2448a5d78de5c251126e7df974d3f5c409 Mon Sep 17 00:00:00 2001 From: chaijunjie0101 <1340011734@qq.com> Date: Fri, 24 Jan 2025 19:36:11 +0800 Subject: [PATCH] HOENIX-7516 TableNotFoundException thrown when not specify schema in CsvBulkloadTool --- .../org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java b/phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java index 142aea63b76..0207f09693b 100644 --- a/phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java +++ b/phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java @@ -237,16 +237,15 @@ private int loadData(Configuration conf, CommandLine cmdLine) throws Exception { 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();