Commit 26630c3
authored
This PR adds support for natively fetching `java.time.*` objects through
the JDBC driver.
DateVector
- getObject(LocalDate.class)
DateTimeVector
- getObject(OffsetDateTime.class)
- getObject(LocalDateTime.class)
- getObject(ZonedDateTime.class)
- getObject(Instant.class)
TimeVector
- getObject(LocalTime.class)
This PR also changes the behavior for vectors that include TZ info.
These will now return as `TIMESTAMP_WITH_TIMEZONE`.
The behavior for different ways to access a TimeStampVector are as
follows:
| | Vector with TZ | Vector W/O TZ |
|---------------------------------|------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| getTimestamp() | Get timestamp in the vector TZ | Get timestamp in UTC
|
| getTimestamp(calendar) | Get timestamp by adjusting from the vector TZ
to the desired calendar TZ | Get timestamp by adjusting from UTC to the
desired calendar TZ (a bug, IMO) |
| getObject(LocalDateTime.class) | Get LocalDateTime by taking the
timestamp at the vector TZ and taking the "wall-clock" time at that
moment | Treat the epoch value in the vector as the "wall-clock" time |
| getObject(Instant.class) | Get Instant represented by the value in the
vector TZ | Get Instant represented by the value in UTC |
| getObject(OffsetDateTime.class) | Get OffsetDateTime represented by
the value in the vector TZ (will account for daylight adjustment) | Get
OffsetDateTime represented by the value in UTC (will account for
daylight adjustment) |
| getObject(ZonedDateTime.class) | Get ZonedDateTime represented by the
value in the vector at in its TZ | Get ZonedDateTime represented by the
value in the vector at in UTC |
Closes #463
1 parent 0d296df commit 26630c3
File tree
7 files changed
+269
-13
lines changed- flight/flight-sql-jdbc-core/src
- main/java/org/apache/arrow/driver/jdbc
- accessor/impl/calendar
- utils
- test/java/org/apache/arrow/driver/jdbc
- accessor/impl/calendar
- utils
7 files changed
+269
-13
lines changedLines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
88 | 103 | | |
89 | 104 | | |
90 | 105 | | |
| |||
134 | 149 | | |
135 | 150 | | |
136 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
137 | 156 | | |
Lines changed: 93 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| |||
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
61 | 72 | | |
62 | 73 | | |
63 | 74 | | |
| |||
68 | 79 | | |
69 | 80 | | |
70 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
71 | 106 | | |
72 | 107 | | |
73 | 108 | | |
74 | 109 | | |
75 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
76 | 138 | | |
77 | 139 | | |
78 | 140 | | |
| |||
85 | 147 | | |
86 | 148 | | |
87 | 149 | | |
88 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
89 | 153 | | |
90 | 154 | | |
91 | 155 | | |
| |||
102 | 166 | | |
103 | 167 | | |
104 | 168 | | |
105 | | - | |
| 169 | + | |
106 | 170 | | |
107 | 171 | | |
108 | 172 | | |
| |||
112 | 176 | | |
113 | 177 | | |
114 | 178 | | |
115 | | - | |
| 179 | + | |
116 | 180 | | |
117 | 181 | | |
118 | 182 | | |
| |||
122 | 186 | | |
123 | 187 | | |
124 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
125 | 207 | | |
126 | 208 | | |
127 | 209 | | |
| |||
170 | 252 | | |
171 | 253 | | |
172 | 254 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 255 | + | |
178 | 256 | | |
179 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
180 | 265 | | |
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
124 | 139 | | |
125 | 140 | | |
126 | 141 | | |
| |||
134 | 149 | | |
135 | 150 | | |
136 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
137 | 156 | | |
138 | 157 | | |
139 | 158 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
304 | 305 | | |
305 | 306 | | |
306 | 307 | | |
| |||
0 commit comments