Skip to content

Commit

Permalink
HOENIX-7516 TableNotFoundException thrown when not specify schema in …
Browse files Browse the repository at this point in the history
…CsvBulkloadTool
  • Loading branch information
chaijunjie0101 committed Jan 25, 2025
1 parent d0a6358 commit c9c5ba2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit c9c5ba2

Please sign in to comment.