A START statement is required

オープン
#127 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java, neo4j
領域
backend, databases

調査の方向性

START ステートメントの要件が報告される AbstractNeo4jItemReader.afterPropertiesSet と、Neo4j の通知によって NullPointerException が発生する BoltResponse.format から調査を始めてください。提供されている reader 設定を使用して、Neo4j 3.5 に対する構成を再現してください。reader の START 動作がサポート対象の Neo4j バージョンと互換性を持ち、報告された例外が発生しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

module: spring-batch-neo4j status: waiting-for-triage type: bug

Bug description

When I use a Neo4jItemReader, like this:

val positionItemReader = new Neo4jItemReader<Position>();
positionItemReader.setStartStatement("n = node(6490)");

I get the following error notification:
notification.title = "The RULE planner is not available in the current CYPHER version, the query has been run by an older CYPHER version."
notification.description = "START is not supported for current CYPHER version, the query has been executed by an older CYPHER version"

Which looks accurate for Neo4j 3.5, as the START clause seems to be deprecated.

Here is the exception:

java.lang.NullPointerException
		at org.neo4j.ogm.drivers.bolt.response.BoltResponse.format(BoltResponse.java:136)
		at org.neo4j.ogm.drivers.bolt.response.BoltResponse.lambda$logNotifications$0(BoltResponse.java:116)
		at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
		at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)
		at org.neo4j.ogm.drivers.bolt.response.BoltResponse.logNotifications(BoltResponse.java:104)
		at org.neo4j.ogm.drivers.bolt.response.BoltResponse.process(BoltResponse.java:92)
		at org.neo4j.ogm.drivers.bolt.response.BoltResponse.close(BoltResponse.java:67)
		at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.lambda$executeAndMap$1(ExecuteQueriesDelegate.java:172)

But if I do this:

val positionItemReader = new Neo4jItemReader<Position>();
positionItemReader.setStartStatement(" ");

It fails too because the start clause is mandatory:

Caused by: java.lang.IllegalStateException: A START statement is required
	at org.springframework.util.Assert.state(Assert.java:76) ~[spring-core-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.batch.item.data.AbstractNeo4jItemReader.afterPropertiesSet(AbstractNeo4jItemReader.java:200) ~[spring-batch-infrastructure-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) **~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]**

Are you sure the START clause is still mandatory, with modern Neo4j? What shall I do, please?

Environment
I use Spring batch (spring-batch-infrastructure-4.2.4.RELEASE.jar), Neo4j driver (neo4j-ogm-bolt-driver 3.2.17) and Neo4j 3.5 in Java 11.

Steps to reproduce

@Bean
  public Neo4jItemReader<Position> positionItemReader() {
    val positionItemReader = new Neo4jItemReader<Position>();
    positionItemReader.setSessionFactory(this.sessionFactory);
    positionItemReader.setName("Position-Reader");
    positionItemReader.setTargetType(Position.class);
    positionItemReader.setPageSize(1);
    positionItemReader.setStartStatement("n = node(6490)");
    positionItemReader.setMatchStatement("(p: Position)");
    positionItemReader.setReturnStatement("p");
    positionItemReader.setOrderByStatement("p.symbol");
    positionItemReader.setParameterValues(new HashMap<>());

    return positionItemReader;
  }

Expected behavior

Maybe I shall use a Neo4jItemReader without a START clause, as it is deprecated?

Thanks in advance.

主要言語
Java
スター
278
フォーク
268
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-projects/spring-batch-extensions のほかの issue

spring-projects/spring-batch-extensions の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。