Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apoc.export.csv.query() does not register duration.inSeconds formatting #1184

Closed
edtky opened this issue Apr 28, 2019 · 5 comments
Closed

apoc.export.csv.query() does not register duration.inSeconds formatting #1184

edtky opened this issue Apr 28, 2019 · 5 comments

Comments

@edtky
Copy link

edtky commented Apr 28, 2019

Guidelines

Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.

Expected Behavior (Mandatory)

CALL apoc.export.csv.query(" ... ... RETURN duration.inSeconds(a.timeStamp, b.timeStamp) ..." )
should return "P0M0DT2651S" in the csv file (only seconds)

Actual Behavior (Mandatory)

wrongly returns "PT44M11S" in csv file (minutes and seconds)
(when queried directly on Neo4j, it correctly returns "P0M0DT930S" on the dashboard)

How to Reproduce the Problem

Simple Dataset (where it's possible)

//Insert here a set of Cypher statements that helps us to reproduce the problem

Steps (Mandatory)

Screenshots (where it's possible)

Screen Shot 2019-04-28 at 11 31 00 AM

Specifications (Mandatory)

Currently used versions

Versions

  • OS:
  • Neo4j:
  • Neo4j-Apoc:
@conker84 conker84 added the Larus label May 3, 2019
@conker84 conker84 self-assigned this May 3, 2019
@vboulaye
Copy link
Contributor

vboulaye commented Oct 5, 2019

Hi,
I tried to work on this issue.
I managed to reproduce it (I made a test in dba589c).

But I cannot figure out how the dashboard is working: the output from csv.query is calling the toString() from DurationValuè which is always computing an hour/minute component from the seconds in the duration.

@enriquezrene
Copy link

@vboulaye
The issue is DurationValue.toString is invoking prettyPrint() which transforms seconds to hours, minutes.

@enriquezrene enriquezrene mentioned this issue Oct 23, 2019
@enriquezrene
Copy link

I think the following PR might work #1322
I took the changes from your commit. @vboulaye

@fbiville
Copy link
Contributor

fbiville commented Mar 5, 2021

I managed to reproduce it (I made a test in dba589c).

Based on a slightly updated variant of this test, the Java API of Neo4j and Cypher-Shell return 1 value: "PT9H5M35.353S".
Neo4j Browser returns another P0M0DT32735.353000000S.
It might be a driver issue.

@conker84
Copy link
Collaborator

@fbiville any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants