Skip to content

Commit 5e75349

Browse files
committed
Fixed paring error with escaped strings.
1 parent bc7ee9c commit 5e75349

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/com/datastax/cdm/CassandraDatasetManager.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class InvalidArgsException extends Exception {
3939
private static final String YAML_URI = "https://raw.githubusercontent.com/riptano/cdm-java/master/datasets.yaml";
4040
private Map<String, Dataset> datasets;
4141
private Session session;
42+
private String cassandraContactPoint;
4243

4344
CassandraDatasetManager() {
4445

@@ -224,7 +225,7 @@ void install(String name) throws IOException, InterruptedException, GitAPIExcept
224225
Config config = mapper.readValue(configFile, Config.class);
225226

226227
{
227-
Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build();
228+
Cluster cluster = Cluster.builder().addContactPoint("10.10.10.1").build();
228229
Session session = cluster.connect();
229230

230231
StringBuilder createKeyspace = new StringBuilder();
@@ -246,7 +247,7 @@ void install(String name) throws IOException, InterruptedException, GitAPIExcept
246247
System.out.println("Loading data");
247248

248249
Cluster cluster2 = Cluster.builder()
249-
.addContactPoint("127.0.0.1")
250+
.addContactPoint("10.10.10.1")
250251
.build();
251252

252253
Session session = cluster2.connect(config.keyspace);
@@ -312,8 +313,7 @@ void install(String name) throws IOException, InterruptedException, GitAPIExcept
312313

313314
CSVParser openCSV(String path) throws IOException {
314315
File f = new File(path);
315-
return CSVParser.parse(f, Charset.forName("UTF-8"),
316-
CSVFormat.RFC4180);
316+
return CSVParser.parse(f, Charset.forName("UTF-8"), CSVFormat.RFC4180.withEscape('\\'));
317317
}
318318

319319
String generateCQL(String table,
@@ -324,6 +324,8 @@ String generateCQL(String table,
324324

325325
needs_quotes.add("text");
326326
needs_quotes.add("datetime");
327+
needs_quotes.add("timestamp");
328+
327329

328330
StringBuilder query = new StringBuilder("INSERT INTO ");
329331
query.append(table);

0 commit comments

Comments
 (0)