Commit 809c0b3
authored
[PECOBLR-1377] SRID in geospatial column type name (databricks#1157)
## Description
This PR enhances geospatial datatype handling to include SRID (Spatial
Reference System Identifier) information in column type names and fixes
multiple issues related to complex datatype handling across different
result formats.
### Key Changes
1. **Geospatial Type Name Enhancement**
- Column type names now include SRID: `GEOMETRY(4326)` instead of
`GEOMETRY`
- Applies to both GEOMETRY and GEOGRAPHY types
- Preserves full type information in metadata for better type
identification
2. **SEA Inline Mode Complex Type Fix**
- Fixed issue where complex types (ARRAY, MAP, STRUCT) were not returned
as complex objects in SEA Inline mode (JSON array result format)
- Now properly converts to complex datatype objects when
`EnableComplexDatatypeSupport=true`
3. **Thrift CloudFetch Metadata Enhancement**
- Fixed error when extracting type details (e.g., `INT` from
`ARRAY<INT>`) in Thrift CloudFetch mode
- Enhanced `getColumnInfoFromTColumnDesc()` to use Arrow schema metadata
alongside `TColumnDesc`
- Arrow schema provides complete type information (e.g., `ARRAY<INT>`)
while `TColumnDesc` only contains base type (e.g., `ARRAY`)
4. **Arrow Metadata Extraction**
- Added `DatabricksThriftUtil.getArrowMetadata()` to deserialize Arrow
schema from `TGetResultSetMetadataResp`
- Fixed null arrow metadata issue in `DatabricksResultSet` constructor
for Thrift CloudFetch mode
## Testing
### Unit Tests
- All existing unit tests pass and additional tests are added for new
methods
### Integration Tests
- `GeospatialTests.java` - Comprehensive E2E integration test
- Tests geospatial types (GEOMETRY and GEOGRAPHY)
- Validates **24 configuration combinations**:
- Protocol: Thrift / SEA
- Serialization: Arrow / Inline
- CloudFetch: Enabled / Disabled (only with Arrow, as CloudFetch
requires Arrow)
- GeoSpatial Support: Enabled / Disabled
- Complex Type Support: Enabled / Disabled
- Validates metadata: column types, type names, class names
- Validates values: WKT representation, SRID
- Validates behavior when geospatial objects are enabled vs. disabled
(STRING fallback)
- **All 24 tests pass** ✅
## Additional Notes to the Reviewer
Other required details are mentioned in comments in the diff
---------
Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>1 parent 8a2f333 commit 809c0b3
File tree
10 files changed
+501
-83
lines changed- src
- main/java/com/databricks/jdbc
- api/impl
- arrow
- converters
- common/util
- test/java/com/databricks/jdbc
- common/util
- integration/e2e
10 files changed
+501
-83
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
Lines changed: 15 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 28 | + | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
| |||
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 153 | + | |
162 | 154 | | |
163 | 155 | | |
164 | 156 | | |
| |||
480 | 472 | | |
481 | 473 | | |
482 | 474 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | 475 | | |
500 | 476 | | |
501 | 477 | | |
| |||
531 | 507 | | |
532 | 508 | | |
533 | 509 | | |
534 | | - | |
535 | | - | |
| 510 | + | |
536 | 511 | | |
537 | | - | |
| 512 | + | |
538 | 513 | | |
539 | | - | |
| 514 | + | |
540 | 515 | | |
541 | 516 | | |
542 | | - | |
543 | | - | |
| 517 | + | |
| 518 | + | |
544 | 519 | | |
545 | 520 | | |
546 | | - | |
| 521 | + | |
547 | 522 | | |
548 | | - | |
| 523 | + | |
549 | 524 | | |
550 | | - | |
| 525 | + | |
551 | 526 | | |
552 | | - | |
| 527 | + | |
| 528 | + | |
553 | 529 | | |
554 | | - | |
| 530 | + | |
| 531 | + | |
555 | 532 | | |
556 | 533 | | |
557 | 534 | | |
| |||
Lines changed: 10 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
| |||
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 125 | + | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
| |||
187 | 191 | | |
188 | 192 | | |
189 | 193 | | |
190 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
191 | 197 | | |
192 | 198 | | |
193 | 199 | | |
| |||
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | 237 | | |
246 | 238 | | |
247 | 239 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
339 | | - | |
| 340 | + | |
| 341 | + | |
340 | 342 | | |
| 343 | + | |
341 | 344 | | |
342 | 345 | | |
343 | 346 | | |
344 | | - | |
345 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
346 | 353 | | |
347 | 354 | | |
348 | 355 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
418 | 420 | | |
419 | 421 | | |
420 | 422 | | |
421 | | - | |
| 423 | + | |
| 424 | + | |
422 | 425 | | |
423 | 426 | | |
424 | 427 | | |
425 | 428 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
430 | 435 | | |
431 | 436 | | |
432 | 437 | | |
| |||
Lines changed: 5 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
| 145 | + | |
143 | 146 | | |
144 | | - | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
169 | 173 | | |
170 | 174 | | |
171 | 175 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | 176 | | |
188 | 177 | | |
189 | 178 | | |
| |||
Lines changed: 49 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| |||
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
213 | | - | |
| 219 | + | |
| 220 | + | |
214 | 221 | | |
215 | 222 | | |
216 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
217 | 236 | | |
218 | 237 | | |
219 | 238 | | |
220 | 239 | | |
221 | 240 | | |
222 | | - | |
| 241 | + | |
| 242 | + | |
223 | 243 | | |
224 | 244 | | |
225 | 245 | | |
| |||
371 | 391 | | |
372 | 392 | | |
373 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
374 | 421 | | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
558 | 574 | | |
0 commit comments