0
votes

This is the error I am getting while loading a CSV file:

Neo.ClientError.Statement.SemanticError: Executing queries that use periodic commit in an open transaction is not possible.

This is the code that I am using:

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:///bs140513_032310.csv' AS line
WITH line,
  SPLIT(line.customer, "'") AS customerID,
  SPLIT(line.age, "'") AS customerAge,
  SPLIT(line.gender, "'") AS customerGender,
  SPLIT(line.zipcodeOri, "'") AS customerZip,
  SPLIT(line.merchant, "'") AS merchantID,
  SPLIT(line.zipMerchant, "'") AS merchantZip,
  SPLIT(line.category, "'") AS transCategory
1

1 Answers

1
votes

Recent versions of the neo4j browser require that you use the :auto browser command to initiate the USING PERIODIC COMMIT option.

For example:

:auto USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:///bs140513_032310.csv' AS line
WITH line,
  SPLIT(line.customer, "'") AS customerID,
  SPLIT(line.age, "'") AS customerAge,
  SPLIT(line.gender, "'") AS customerGender,
  SPLIT(line.zipcodeOri, "'") AS customerZip,
  SPLIT(line.merchant, "'") AS merchantID,
  SPLIT(line.zipMerchant, "'") AS merchantZip,
  SPLIT(line.category, "'") AS transCategory

You can get a little more info on :auto in the browser by entering this browser command:

:help auto