Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Treat table name without case sensitive; Offer a more readable error …

…for the insert procedure
  • Loading branch information...
commit 832796955b750524b3d9784b857908725f8c8cba 1 parent fcb4295
Xin Jia authored
View
12 src/frontend/org/voltdb/utils/CSVLoader.java
@@ -233,17 +233,25 @@ public static void main(String[] args) throws IOException,
int columnCnt = 0;
VoltTable procInfo = null;
+ boolean isProcExist = false;
try {
procInfo = csvClient.callProcedure("@SystemCatalog",
"PROCEDURECOLUMNS").getResults()[0];
while (procInfo.advanceRow()) {
if (insertProcedure.matches((String) procInfo.get(
- "PROCEDURE_NAME", VoltType.STRING)))
+ "PROCEDURE_NAME", VoltType.STRING))) {
columnCnt++;
+ isProcExist = true;
+ }
}
} catch (Exception e) {
e.printStackTrace();

It would be good if we could be more descriptive about the origin of the error than displaying just the callstack.

@jxchinaren Owner

Thanks for your suggestion. Already fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
}
+ if (isProcExist == false) {
+ m_log.error("No matching insert procedure available");
+ close_cleanup();
+ System.exit(-1);
+ }
while ((config.limitrows-- > 0)
&& (line = csvReader.readNext()) != null) {
@@ -340,7 +348,7 @@ private static void configuration() {
if (config.file.equals(""))
standin = true;
if (!config.table.equals("")) {
- insertProcedure = config.table + ".insert";
+ insertProcedure = config.table.toUpperCase() + ".insert";
} else {
insertProcedure = config.procedure;
}
View
4 tests/frontend/org/voltdb/utils/TestCSVLoader.java
@@ -181,7 +181,7 @@ public void testCommon() throws Exception
"); ";
String []myOptions = {
"-f" + reportDir + "/test.csv",
- //"--procedure=BLAH.insert",
+ //"--procedure=blah.insert",
"--reportdir=" + reportDir,
//"--table=BLAH",
"--maxerrors=50",
@@ -195,7 +195,7 @@ public void testCommon() throws Exception
"--skip=0",
"--nowhitespace",
//"--strictquotes",
- "BLAH"
+ "BlAh"
};
String currentTime = new TimestampType().toString();
String []myData = { "1,1,1,11111111,first,1.10,1.11,"+currentTime,
@Wombat42

It would be good if we could be more descriptive about the origin of the error than displaying just the callstack.

@jxchinaren

Thanks for your suggestion. Already fix it.

Please sign in to comment.
Something went wrong with that request. Please try again.