Skip to content

Commit

Permalink
MONDRIAN: Fixes to MondrianFoodMartLoader for Infobright bulk loading…
Browse files Browse the repository at this point in the history
… (untested).

[git-p4: depot-paths = "//open/mondrian-release/3.2/": change = 14104]
  • Loading branch information
julianhyde committed Feb 9, 2011
1 parent 59bd3c5 commit 47d9755
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions testsrc/main/mondrian/test/loader/MondrianFoodMartLoader.java
Expand Up @@ -3,7 +3,7 @@
// This software is subject to the terms of the Eclipse Public License v1.0
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2004-2010 Julian Hyde
// Copyright (C) 2004-2011 Julian Hyde
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
Expand Down Expand Up @@ -648,7 +648,10 @@ private void loadDataFromFile(
massagedLine.setLength(0);
getMassagedValues(massagedLine, orderedColumns, values);
fileOutput.write(
massagedLine.toString().replace('\'', '"').trim());
massagedLine.toString()
.replaceAll("\"", "\\\"")
.replace('\'', '"')
.trim());
fileOutput.write(nl);
} else {
massagedLine.setLength(0);
Expand Down Expand Up @@ -724,7 +727,8 @@ private void afterTable(
+ "' INTO TABLE "
+ (schema != null ? schema + "." : "")
+ table
+ " FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'";
+ " FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'"
+ " ESCAPED BY '\\\\'";
Statement statement = null;
try {
statement = connection.createStatement();
Expand Down

0 comments on commit 47d9755

Please sign in to comment.