Commit c2523f2
committed
refactor: unify ResultSet implementations on Arrow-backed path
Collapse the two ResultSet families (streaming Arrow + row-based
metadata) into a single Arrow-backed implementation so there is one
accessor pipeline, one set of type semantics, and one place to fix bugs.
Changes:
- ArrowStreamReaderCursor becomes source-agnostic: a BatchLoader drives
a VectorSchemaRoot, whether sourced from an ArrowStreamReader or a
pre-populated in-memory batch. The cursor also owns an AutoCloseable
so it is responsible for releasing the allocator + reader on close —
the old ArrowStreamReader.close() would only tear down vectors and
leak the 100 MB RootAllocator.
- QueryResultArrowStream.toArrowStreamReader returns a Result holder
that pairs the reader with the allocator and closes both in the
right order so Arrow's accounting invariants hold.
- StreamingResultSet gains ofInMemory(root, owned, queryId, zone, cols)
so metadata results funnel through the same result set. A columns
override preserves the JDBC-spec typeName labels (e.g. TEXT) that
would otherwise be lost when deriving from the Arrow schema.
- MetadataArrowBuilder materialises List<List<Object>> metadata rows
into a populated VectorSchemaRoot using the existing HyperTypeToArrow
mapping; MetadataResultSets is the factory callers use.
- QueryMetadataUtil and DataCloudDatabaseMetadata route getTables,
getColumns, getSchemas, getTypeInfo and empty metadata results
through the Arrow-backed StreamingResultSet.
- DataCloudMetadataResultSet, SimpleResultSet, and ColumnAccessor are
removed now that no caller depends on them.
- StreamingResultSet.getObject(int, Class) gains an isInstance-based
fallback so callers can retrieve String-typed VARCHAR columns without
each accessor having to implement typed getObject.
- Tests moved to the unified path; integer-accessor-only assertions in
DataCloudDatabaseMetadataTest updated to reflect stricter Arrow
accessor semantics.1 parent ec73677 commit c2523f2
19 files changed
Lines changed: 563 additions & 1220 deletions
File tree
- jdbc-core/src
- main/java/com/salesforce/datacloud/jdbc
- core
- metadata
- resultset
- protocol
- test/java/com/salesforce/datacloud/jdbc
- core
- metadata
- resultset
- protocol
Lines changed: 65 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
24 | 36 | | |
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
30 | 44 | | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
40 | 60 | | |
41 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
42 | 67 | | |
43 | | - | |
44 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
45 | 92 | | |
46 | 93 | | |
47 | 94 | | |
48 | | - | |
| 95 | + | |
49 | 96 | | |
50 | 97 | | |
51 | 98 | | |
| |||
59 | 106 | | |
60 | 107 | | |
61 | 108 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
65 | 112 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
69 | 116 | | |
70 | 117 | | |
71 | 118 | | |
| |||
76 | 123 | | |
77 | 124 | | |
78 | 125 | | |
79 | | - | |
| 126 | + | |
80 | 127 | | |
81 | 128 | | |
82 | 129 | | |
| |||
97 | 144 | | |
98 | 145 | | |
99 | 146 | | |
100 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
101 | 150 | | |
102 | 151 | | |
Lines changed: 11 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | | - | |
| 709 | + | |
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
| 715 | + | |
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
721 | | - | |
| 721 | + | |
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
| 726 | + | |
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
731 | | - | |
| 731 | + | |
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
| 741 | + | |
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
753 | | - | |
| 753 | + | |
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
758 | | - | |
759 | | - | |
| 758 | + | |
760 | 759 | | |
761 | 760 | | |
762 | 761 | | |
763 | 762 | | |
764 | 763 | | |
765 | | - | |
| 764 | + | |
766 | 765 | | |
767 | 766 | | |
768 | 767 | | |
| |||
Lines changed: 0 additions & 164 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments