Импорт bitcoin блокчейна в neo4j - ошибка: отсутствует обязательная опция '--nodes = [<label> [: <label>] ... =] <files>' - PullRequest
0 голосов
/ 17 марта 2020

Я пытаюсь импортировать bitcoin блокчейн в neo4j. Существует четыре файла

1- tx_header.csv - tx_hash:ID, timestamp
2- outputs_headers.csv - tx_hash:ID, wallet_address:END_ID, amount
3- inputs_headers.csv - wallet_address:START_ID, tx_hash:END_ID, amount
4- add_headers.csv - wallet_address:ID

, которые содержат информацию заголовка, а сведения о содержимом находятся в других файлах csv. Когда я пытаюсь:

neo4j-admin import 
    --nodes:Transaction $DATA/transactions/transaction/tx_headers.csv,$DATA/transactions/transaction/transaction_unique.csv 
    --nodes:Address $DATA/add/address/add_headers.csv,$DATA/add/address/unique_address.csv
    --relationships:Output $DATA/outputs/outputs_headers.csv,$DATA/outputs/outputs.csv 
    --relationships:Input $DATA/inputs/inputs/inputs_headers.csv,$DATA/inputs/inputs/inputs1.csv 
    --ignore-missing-nodes=true 

я получаю сообщение: я использую версию 4.0.1

    WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
Missing required option '--nodes=[<label>[:<label>]...=]<files>'
[picocli WARN] Could not format 'Maximum memory that neo4j-admin can use for various data structures and caching to improve performance. Values can be plain numbers, like 10000000 or e.g. 20G for 20 gigabyte, or even e.g. 70%.' (Underlying error: Conversion = '.'). Using raw String: '%n' format strings have not been replaced with newlines. Please ensure to escape '%' characters with another '%'.
[picocli WARN] Could not format 'Maximum memory that neo4j-admin can use for various data structures and caching to improve performance. Values can be plain numbers, like 10000000 or e.g. 20G for 20 gigabyte, or even e.g. 70%.' (Underlying error: Conversion = '.'). Using raw String: '%n' format strings have not been replaced with newlines. Please ensure to escape '%' characters with another '%'.
[picocli WARN] Could not format 'Maximum memory that neo4j-admin can use for various data structures and caching to improve performance. Values can be plain numbers, like 10000000 or e.g. 20G for 20 gigabyte, or even e.g. 70%.' (Underlying error: Conversion = '.'). Using raw String: '%n' format strings have not been replaced with newlines. Please ensure to escape '%' characters with another '%'.


USAGE

neo4j-admin import [--verbose] [--cache-on-heap[=<true/false>]] [--high-io
                   [=<true/false>]] [--ignore-empty-strings[=<true/false>]]
                   [--ignore-extra-columns[=<true/false>]]
                   [--legacy-style-quoting[=<true/false>]] [--multiline-fields
                   [=<true/false>]] [--normalize-types[=<true/false>]]
                   [--skip-bad-entries-logging[=<true/false>]]
                   [--skip-bad-relationships[=<true/false>]]
                   [--skip-duplicate-nodes[=<true/false>]] [--trim-strings
                   [=<true/false>]] [--additional-config=<path>]
                   [--array-delimiter=<char>] [--bad-tolerance=<num>]
                   [--database=<database>] [--delimiter=<char>]
                   [--id-type=<STRING|INTEGER|ACTUAL>]
                   [--input-encoding=<character-set>] [--max-memory=<size>]
                   [--processors=<num>] [--quote=<char>]
                   [--read-buffer-size=<size>] [--report-file=<path>] --nodes=
                   [<label>[:<label>]...=]<files>... [--nodes=[<label>[:
                   <label>]...=]<files>...]... [--relationships=[<type>=]
                   <files>...]...

DESCRIPTION

Import a collection of CSV files.

OPTIONS

      --verbose              Enable verbose output.
      --database=<database>  Name of the database to import.
                               Default: neo4j
      --additional-config=<path>
                             Configuration file to supply additional
                               configuration in.
      --report-file=<path>   File in which to store the report of the
                               csv-import.
                               Default: import.report
      --id-type=<STRING|INTEGER|ACTUAL>
                             Each node must provide a unique id. This is used
                               to find the correct nodes when creating
                               relationships. Possible values are:
                               STRING: arbitrary strings for identifying nodes,
                               INTEGER: arbitrary integer values for
                               identifying nodes,
                               ACTUAL: (advanced) actual node ids.
                             For more information on id handling, please see
                               the Neo4j Manual: https://neo4j.
                               com/docs/operations-manual/current/tools/import/
                               Default: STRING
      --input-encoding=<character-set>
                             Character set that input data is encoded in.
                               Default: UTF-8
      --ignore-extra-columns[=<true/false>]
                             If un-specified columns should be ignored during
                               the import.
                               Default: false
      --multiline-fields[=<true/false>]
                             Whether or not fields from input source can span
                               multiple lines, i.e. contain newline characters.
                               Default: false
      --ignore-empty-strings[=<true/false>]
                             Whether or not empty string fields, i.e. "" from
                               input source are ignored, i.e. treated as null.
                               Default: false
      --trim-strings[=<true/false>]
                             Whether or not strings should be trimmed for
                               whitespaces.
                               Default: false
      --legacy-style-quoting[=<true/false>]
                             Whether or not backslash-escaped quote e.g. \" is
                               interpreted as inner quote.
                               Default: false
      --delimiter=<char>     Delimiter character between values in CSV data.
                               Default: ,
      --array-delimiter=<char>
                             Delimiter character between array elements within
                               a value in CSV data.
                               Default: ;
      --quote=<char>         Character to treat as quotation character for
                               values in CSV data. Quotes can be escaped as per
                               RFC 4180 by doubling them, for example "" would
                               be interpreted as a literal ". You cannot escape
                               using \.
                               Default: "
      --read-buffer-size=<size>
                             Size of each buffer for reading input data. It has
                               to at least be large enough to hold the biggest
                               single value in the input data.
                               Default: 4194304
      --max-memory=<size>    Maximum memory that neo4j-admin can use for
                               various data structures and caching to improve
                               performance. Values can be plain numbers, like
                               10000000 or e.g. 20G for 20 gigabyte, or even e.
                               g. 70%.
                               Default: 90%
      --high-io[=<true/false>]
                             Ignore environment-based heuristics, and assume
                               that the target storage subsystem can support
                               parallel IO with high throughput.
                               Default: false
      --cache-on-heap[=<true/false>]
                             (advanced) Whether or not to allow allocating
                               memory for the cache on heap. If 'false' then
                               caches will still be allocated off-heap, but the
                               additional free memory inside the JVM will not
                               be allocated for the caches. This to be able to
                               have better control over the heap memory
                               Default: false
      --processors=<num>     (advanced) Max number of processors used by the
                               importer. Defaults to the number of available
                               processors reported by the JVM. There is a
                               certain amount of minimum threads needed so for
                               that reason there is no lower bound for this
                               value. For optimal performance this value
                               shouldn't be greater than the number of
                               available processors.
                               Default: 8
      --bad-tolerance=<num>  Number of bad entries before the import is
                               considered failed. This tolerance threshold is
                               about relationships referring to missing nodes.
                               Format errors in input data are still treated as
                               errors
                               Default: 1000
      --skip-bad-entries-logging[=<true/false>]
                             Whether or not to skip logging bad entries
                               detected during import.
                               Default: false
      --skip-bad-relationships[=<true/false>]
                             Whether or not to skip importing relationships
                               that refers to missing node ids, i.e. either
                               start or end node id/group referring to node
                               that wasn't specified by the node input data.
                               Skipped nodes will be logged, containing at most
                               number of entities specified by bad-tolerance,
                               unless otherwise specified by
                               skip-bad-entries-logging option.
                               Default: false
      --skip-duplicate-nodes[=<true/false>]
                             Whether or not to skip importing nodes that have
                               the same id/group. In the event of multiple
                               nodes within the same group having the same id,
                               the first encountered will be imported whereas
                               consecutive such nodes will be skipped. Skipped
                               nodes will be logged, containing at most number
                               of entities specified by bad-tolerance, unless
                               otherwise specified by skip-bad-entries-logging
                               option.
                               Default: false
      --normalize-types[=<true/false>]
                             Whether or not to normalize property types to
                               Cypher types, e.g. 'int' becomes 'long' and
                               'float' becomes 'double'
                               Default: true
      --nodes=[<label>[:<label>]...=]<files>...
                             Node CSV header and data. Multiple files will be
                               logically seen as one big file from the
                               perspective of the importer. The first line must
                               contain the header. Multiple data sources like
                               these can be specified in one import, where each
                               data source has its own header.
      --relationships=[<type>=]<files>...
                             Relationship CSV header and data. Multiple files
                               will be logically seen as one big file from the
                               perspective of the importer. The first line must
                               contain the header. Multiple data sources like
                               these can be specified in one import, where each
                               data source has its own header.

Я уже указал --nodes = ......... уже , как решить это? команда представляет собой одну строку без разрывов.

1 Ответ

1 голос
/ 17 марта 2020

[ОБНОВЛЕНО]

Попробуйте поместить всю команду в одну строку и измените параметры --nodes и --relationships, чтобы при необходимости использовать знак равенства ("=").

Это может работать лучше для вас:

neo4j-admin import --nodes=Transactions="$DATA/transactions/transaction/tx_headers.csv,$DATA/transactions/transaction/transaction_unique.csv" --nodes=Address="$DATA/add/address/add_headers.csv,$DATA/add/address/unique_address.csv" --relationships=Output="$DATA/outputs/outputs_headers.csv,$DATA/outputs/outputs.csv" --relationships=Input="$DATAinputs_/inputs/inputs_headers.csv,$DATAinputs1/inputs/inputs1.csv" --ignore-missing-nodes=true

Или вы можете использовать соответствующий синтаксис продолжения строки для вашей операционной системы. Например, в Linux или OSX вы можете использовать обратную косую черту sh (\) перед символом новой строки, чтобы разбить командную строку:

neo4j-admin import \
  --nodes=Transactions="$DATA/transactions/transaction/tx_headers.csv,$DATA/transactions/transaction/transaction_unique.csv" \
  --nodes=Address="$DATA/add/address/add_headers.csv,$DATA/add/address/unique_address.csv" \
  --relationships=Output="$DATA/outputs/outputs_headers.csv,$DATA/outputs/outputs.csv" \
  --relationships=Input="$DATAinputs_/inputs/inputs_headers.csv,$DATAinputs1/inputs/inputs1.csv" \
  --ignore-missing-nodes=true

В Windows, символ вставки (^) можно использовать вместо обратного знака sh.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...