-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29387][SQL] Support * and / operators for intervals
#26132
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
Changes from 1 commit
af2e7ab
4227915
379a20a
3e9ed0f
670a7c6
3ae94cf
3bce68e
754109c
166dbd8
b4dc59a
1e2a9a6
a6b6d81
6e569c0
69a3cc7
001d17b
014cde5
049f428
1ca7c89
9e6745a
b428070
8ad4001
91337e5
2bb916f
6ba53f0
719fe6c
d05ffa4
34f6605
00ede6c
690d9c1
5b25432
2265449
e559fb9
35ab9c0
dbc39e8
8244460
b70c0f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -356,11 +356,11 @@ public CalendarInterval subtract(CalendarInterval that) { | |
| } | ||
|
|
||
| private static CalendarInterval fromDoubles(double months, double microseconds) { | ||
| long roundedMonths = (long)(months); | ||
| long truncatedMonths = (long)(months); | ||
| // Using 30 days per month as PostgreSQL does. | ||
| double microsInMonth = 30 * MICROS_PER_DAY * (months - roundedMonths); | ||
| long roundedMicroseconds = (long)(microseconds + microsInMonth); | ||
| return new CalendarInterval(Math.toIntExact(roundedMonths), roundedMicroseconds); | ||
| double microsInMonth = 30 * MICROS_PER_DAY * (months - truncatedMonths); | ||
| long truncatedMicroseconds = (long)(microseconds + microsInMonth); | ||
| return new CalendarInterval(Math.toIntExact(truncatedMonths), truncatedMicroseconds); | ||
| } | ||
|
|
||
| public CalendarInterval multiply(double num) { | ||
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.