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

Support multiply(long, java.time.Duration) #5379

Closed
alexpeters1208 opened this issue Apr 17, 2024 · 1 comment · Fixed by #5509
Closed

Support multiply(long, java.time.Duration) #5379

alexpeters1208 opened this issue Apr 17, 2024 · 1 comment · Fixed by #5509
Assignees
Labels
feature request New feature or request triage
Milestone

Comments

@alexpeters1208
Copy link
Contributor

This code block:

time_ops = empty_table(10).update(
    [
        "BaseTime = '2021-07-11T12:00:00.000Z'",
        "Timestamp = BaseTime + (ii * 'PT1h')"
    ]
)

Fails because multiply(long, java.time.Duration) is not implemented. There are a couple of alternatives:

time_ops = empty_table(10).update(
    [
        "BaseTime = '2021-07-11T12:00:00.000Z'",
        "Timestamp = BaseTime + 'PT1h'.multipliedBy(ii)"
    ]
)

or

time_ops = empty_table(10).update(
    [
        "BaseTime = '2021-07-11T12:00:00.000Z'",
        "Timestamp = BaseTime + (ii * HOUR)"
    ]
)

However, I think supporting multiply(long, java.time.Duration) is reasonable and well-defined.

@alexpeters1208 alexpeters1208 added feature request New feature or request triage labels Apr 17, 2024
@devinrsmith devinrsmith added this to the 3. Triage milestone Apr 17, 2024
@chipkent
Copy link
Member

chipkent commented May 20, 2024

The same problem exists for both Period and Duration.

from deephaven import empty_table
t2 = empty_table(10).update(["P = 'P2D'", "D = 'PT2h'"])
t3 = t2.update("P2=P*2")
t4 = t2.update("D2 = D*2")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request triage
Projects
None yet
3 participants