@qualithm/arrow-flight-client 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -14
- package/dist/client/flight-client.d.ts.map +1 -1
- package/dist/client/flight-client.js +5 -9
- package/dist/client/flight-client.js.map +1 -1
- package/dist/client/flight-sql-client.d.ts.map +1 -1
- package/dist/client/flight-sql-client.js +5 -8
- package/dist/client/flight-sql-client.js.map +1 -1
- package/dist/gen/arrow/flight/FlightSql_pb.d.ts +2382 -1962
- package/dist/gen/arrow/flight/FlightSql_pb.js +316 -1957
- package/dist/gen/arrow/flight/Flight_pb.d.ts +847 -720
- package/dist/gen/arrow/flight/Flight_pb.js +119 -230
- package/dist/testing/builders.d.ts +53 -0
- package/dist/testing/builders.d.ts.map +1 -0
- package/dist/testing/builders.js +95 -0
- package/dist/testing/builders.js.map +1 -0
- package/dist/testing/descriptors.d.ts +43 -0
- package/dist/testing/descriptors.d.ts.map +1 -0
- package/dist/testing/descriptors.js +47 -0
- package/dist/testing/descriptors.js.map +1 -0
- package/dist/testing/helpers.d.ts +70 -0
- package/dist/testing/helpers.d.ts.map +1 -0
- package/dist/testing/helpers.js +95 -0
- package/dist/testing/helpers.js.map +1 -0
- package/dist/testing/index.d.ts +44 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +49 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/streams.d.ts +88 -0
- package/dist/testing/streams.d.ts.map +1 -0
- package/dist/testing/streams.js +112 -0
- package/dist/testing/streams.js.map +1 -0
- package/package.json +17 -7
- package/dist/gen/arrow/flight/FlightSql_pb.d.ts.map +0 -1
- package/dist/gen/arrow/flight/FlightSql_pb.js.map +0 -1
- package/dist/gen/arrow/flight/Flight_pb.d.ts.map +0 -1
- package/dist/gen/arrow/flight/Flight_pb.js.map +0 -1
|
@@ -14,330 +14,256 @@
|
|
|
14
14
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
// See the License for the specific language governing permissions and
|
|
16
16
|
// limitations under the License.
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
|
|
18
|
+
// @generated by protoc-gen-es v2.11.0 with parameter "target=js+dts"
|
|
19
|
+
// @generated from file arrow/flight/Flight.proto (package arrow.flight.protocol, syntax proto3)
|
|
20
|
+
/* eslint-disable */
|
|
21
|
+
|
|
22
|
+
import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/protobuf/codegenv2"
|
|
23
|
+
import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"
|
|
24
|
+
|
|
19
25
|
/**
|
|
20
26
|
* Describes the file arrow/flight/Flight.proto.
|
|
21
27
|
*/
|
|
22
|
-
export const file_arrow_flight_Flight =
|
|
23
|
-
/*@__PURE__*/
|
|
24
|
-
fileDesc(
|
|
28
|
+
export const file_arrow_flight_Flight =
|
|
29
|
+
/*@__PURE__*/
|
|
30
|
+
fileDesc(
|
|
31
|
+
"ChlhcnJvdy9mbGlnaHQvRmxpZ2h0LnByb3RvEhVhcnJvdy5mbGlnaHQucHJvdG9jb2wiPQoQSGFuZHNoYWtlUmVxdWVzdBIYChBwcm90b2NvbF92ZXJzaW9uGAEgASgEEg8KB3BheWxvYWQYAiABKAwiPgoRSGFuZHNoYWtlUmVzcG9uc2USGAoQcHJvdG9jb2xfdmVyc2lvbhgBIAEoBBIPCgdwYXlsb2FkGAIgASgMIi8KCUJhc2ljQXV0aBIQCgh1c2VybmFtZRgCIAEoCRIQCghwYXNzd29yZBgDIAEoCSIHCgVFbXB0eSIvCgpBY3Rpb25UeXBlEgwKBHR5cGUYASABKAkSEwoLZGVzY3JpcHRpb24YAiABKAkiHgoIQ3JpdGVyaWESEgoKZXhwcmVzc2lvbhgBIAEoDCIkCgZBY3Rpb24SDAoEdHlwZRgBIAEoCRIMCgRib2R5GAIgASgMIhYKBlJlc3VsdBIMCgRib2R5GAEgASgMIh4KDFN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29sLlNjaGVtYVJlc3VsdCIAEk0KBURvR2V0Eh0uYXJyb3cuZmxpZ2h0LnByb3RvY29sLlRpY2tldBohLmFycm93LmZsaWdodC5wcm90b2NvbC5GbGlnaHREYXRhIgAwARJSCgVEb1B1dBIhLmFycm93LmZsaWdodC5wcm90b2NvbC5GbGlnaHREYXRhGiAuYXJyb3cuZmxpZ2h0LnByb3RvY29sLlB1dFJlc3VsdCIAKAEwARJYCgpEb0V4Y2hhbmdlEiEuYXJyb3cuZmxpZ2h0LnByb3RvY29sLkZsaWdodERhdGEaIS5hcnJvdy5mbGlnaHQucHJvdG9jb2wuRmxpZ2h0RGF0YSIAKAEwARJMCghEb0FjdGlvbhIdLmFycm93LmZsaWdodC5wcm90b2NvbC5BY3Rpb24aHS5hcnJvdy5mbGlnaHQucHJvdG9jb2wuUmVzdWx0IgAwARJSCgtMaXN0QWN0aW9ucxIcLmFycm93LmZsaWdodC5wcm90b2NvbC5FbXB0eRohLmFycm93LmZsaWdodC5wcm90b2NvbC5BY3Rpb25UeXBlIgAwAUJxChxvcmcuYXBhY2hlLmFycm93LmZsaWdodC5pbXBsWjJnaXRodWIuY29tL2FwYWNoZS9hcnJvdy1nby9hcnJvdy9mbGlnaHQvZ2VuL2ZsaWdodKoCHEFwYWNoZS5BcnJvdy5GbGlnaHQuUHJvdG9jb2xiBnByb3RvMw",
|
|
32
|
+
[file_google_protobuf_timestamp]
|
|
33
|
+
)
|
|
34
|
+
|
|
25
35
|
/**
|
|
26
36
|
* Describes the message arrow.flight.protocol.HandshakeRequest.
|
|
27
37
|
* Use `create(HandshakeRequestSchema)` to create a new message.
|
|
28
38
|
*/
|
|
29
|
-
export const HandshakeRequestSchema =
|
|
30
|
-
|
|
31
|
-
messageDesc(file_arrow_flight_Flight, 0);
|
|
39
|
+
export const HandshakeRequestSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 0)
|
|
40
|
+
|
|
32
41
|
/**
|
|
33
42
|
* Describes the message arrow.flight.protocol.HandshakeResponse.
|
|
34
43
|
* Use `create(HandshakeResponseSchema)` to create a new message.
|
|
35
44
|
*/
|
|
36
|
-
export const HandshakeResponseSchema =
|
|
37
|
-
|
|
38
|
-
messageDesc(file_arrow_flight_Flight, 1);
|
|
45
|
+
export const HandshakeResponseSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 1)
|
|
46
|
+
|
|
39
47
|
/**
|
|
40
48
|
* Describes the message arrow.flight.protocol.BasicAuth.
|
|
41
49
|
* Use `create(BasicAuthSchema)` to create a new message.
|
|
42
50
|
*/
|
|
43
|
-
export const BasicAuthSchema =
|
|
44
|
-
|
|
45
|
-
messageDesc(file_arrow_flight_Flight, 2);
|
|
51
|
+
export const BasicAuthSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 2)
|
|
52
|
+
|
|
46
53
|
/**
|
|
47
54
|
* Describes the message arrow.flight.protocol.Empty.
|
|
48
55
|
* Use `create(EmptySchema)` to create a new message.
|
|
49
56
|
*/
|
|
50
|
-
export const EmptySchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 3)
|
|
57
|
+
export const EmptySchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 3)
|
|
58
|
+
|
|
51
59
|
/**
|
|
52
60
|
* Describes the message arrow.flight.protocol.ActionType.
|
|
53
61
|
* Use `create(ActionTypeSchema)` to create a new message.
|
|
54
62
|
*/
|
|
55
|
-
export const ActionTypeSchema =
|
|
56
|
-
|
|
57
|
-
messageDesc(file_arrow_flight_Flight, 4);
|
|
63
|
+
export const ActionTypeSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 4)
|
|
64
|
+
|
|
58
65
|
/**
|
|
59
66
|
* Describes the message arrow.flight.protocol.Criteria.
|
|
60
67
|
* Use `create(CriteriaSchema)` to create a new message.
|
|
61
68
|
*/
|
|
62
|
-
export const CriteriaSchema =
|
|
63
|
-
|
|
64
|
-
messageDesc(file_arrow_flight_Flight, 5);
|
|
69
|
+
export const CriteriaSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 5)
|
|
70
|
+
|
|
65
71
|
/**
|
|
66
72
|
* Describes the message arrow.flight.protocol.Action.
|
|
67
73
|
* Use `create(ActionSchema)` to create a new message.
|
|
68
74
|
*/
|
|
69
|
-
export const ActionSchema =
|
|
70
|
-
|
|
71
|
-
messageDesc(file_arrow_flight_Flight, 6);
|
|
75
|
+
export const ActionSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 6)
|
|
76
|
+
|
|
72
77
|
/**
|
|
73
78
|
* Describes the message arrow.flight.protocol.Result.
|
|
74
79
|
* Use `create(ResultSchema)` to create a new message.
|
|
75
80
|
*/
|
|
76
|
-
export const ResultSchema =
|
|
77
|
-
|
|
78
|
-
messageDesc(file_arrow_flight_Flight, 7);
|
|
81
|
+
export const ResultSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 7)
|
|
82
|
+
|
|
79
83
|
/**
|
|
80
84
|
* Describes the message arrow.flight.protocol.SchemaResult.
|
|
81
85
|
* Use `create(SchemaResultSchema)` to create a new message.
|
|
82
86
|
*/
|
|
83
|
-
export const SchemaResultSchema =
|
|
84
|
-
|
|
85
|
-
messageDesc(file_arrow_flight_Flight, 8);
|
|
87
|
+
export const SchemaResultSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 8)
|
|
88
|
+
|
|
86
89
|
/**
|
|
87
90
|
* Describes the message arrow.flight.protocol.FlightDescriptor.
|
|
88
91
|
* Use `create(FlightDescriptorSchema)` to create a new message.
|
|
89
92
|
*/
|
|
90
|
-
export const FlightDescriptorSchema =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
export const FlightDescriptorSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 9)
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Describes the enum arrow.flight.protocol.FlightDescriptor.DescriptorType.
|
|
97
|
+
*/
|
|
98
|
+
export const FlightDescriptor_DescriptorTypeSchema =
|
|
99
|
+
/*@__PURE__*/
|
|
100
|
+
enumDesc(file_arrow_flight_Flight, 9, 0)
|
|
101
|
+
|
|
93
102
|
/**
|
|
94
103
|
*
|
|
95
104
|
* Describes what type of descriptor is defined.
|
|
96
105
|
*
|
|
97
106
|
* @generated from enum arrow.flight.protocol.FlightDescriptor.DescriptorType
|
|
98
107
|
*/
|
|
99
|
-
export
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
*
|
|
104
|
-
* @generated from enum value: UNKNOWN = 0;
|
|
105
|
-
*/
|
|
106
|
-
FlightDescriptor_DescriptorType[FlightDescriptor_DescriptorType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
* A named path that identifies a dataset. A path is composed of a string
|
|
110
|
-
* or list of strings describing a particular dataset. This is conceptually
|
|
111
|
-
* similar to a path inside a filesystem.
|
|
112
|
-
*
|
|
113
|
-
* @generated from enum value: PATH = 1;
|
|
114
|
-
*/
|
|
115
|
-
FlightDescriptor_DescriptorType[FlightDescriptor_DescriptorType["PATH"] = 1] = "PATH";
|
|
116
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
* An opaque command to generate a dataset.
|
|
119
|
-
*
|
|
120
|
-
* @generated from enum value: CMD = 2;
|
|
121
|
-
*/
|
|
122
|
-
FlightDescriptor_DescriptorType[FlightDescriptor_DescriptorType["CMD"] = 2] = "CMD";
|
|
123
|
-
})(FlightDescriptor_DescriptorType || (FlightDescriptor_DescriptorType = {}));
|
|
124
|
-
/**
|
|
125
|
-
* Describes the enum arrow.flight.protocol.FlightDescriptor.DescriptorType.
|
|
126
|
-
*/
|
|
127
|
-
export const FlightDescriptor_DescriptorTypeSchema =
|
|
128
|
-
/*@__PURE__*/
|
|
129
|
-
enumDesc(file_arrow_flight_Flight, 9, 0);
|
|
108
|
+
export const FlightDescriptor_DescriptorType =
|
|
109
|
+
/*@__PURE__*/
|
|
110
|
+
tsEnum(FlightDescriptor_DescriptorTypeSchema)
|
|
111
|
+
|
|
130
112
|
/**
|
|
131
113
|
* Describes the message arrow.flight.protocol.FlightInfo.
|
|
132
114
|
* Use `create(FlightInfoSchema)` to create a new message.
|
|
133
115
|
*/
|
|
134
|
-
export const FlightInfoSchema =
|
|
135
|
-
|
|
136
|
-
messageDesc(file_arrow_flight_Flight, 10);
|
|
116
|
+
export const FlightInfoSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 10)
|
|
117
|
+
|
|
137
118
|
/**
|
|
138
119
|
* Describes the message arrow.flight.protocol.PollInfo.
|
|
139
120
|
* Use `create(PollInfoSchema)` to create a new message.
|
|
140
121
|
*/
|
|
141
|
-
export const PollInfoSchema =
|
|
142
|
-
|
|
143
|
-
messageDesc(file_arrow_flight_Flight, 11);
|
|
122
|
+
export const PollInfoSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 11)
|
|
123
|
+
|
|
144
124
|
/**
|
|
145
125
|
* Describes the message arrow.flight.protocol.CancelFlightInfoRequest.
|
|
146
126
|
* Use `create(CancelFlightInfoRequestSchema)` to create a new message.
|
|
147
127
|
*/
|
|
148
|
-
export const CancelFlightInfoRequestSchema =
|
|
149
|
-
|
|
150
|
-
messageDesc(file_arrow_flight_Flight, 12);
|
|
128
|
+
export const CancelFlightInfoRequestSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 12)
|
|
129
|
+
|
|
151
130
|
/**
|
|
152
131
|
* Describes the message arrow.flight.protocol.CancelFlightInfoResult.
|
|
153
132
|
* Use `create(CancelFlightInfoResultSchema)` to create a new message.
|
|
154
133
|
*/
|
|
155
|
-
export const CancelFlightInfoResultSchema =
|
|
156
|
-
|
|
157
|
-
messageDesc(file_arrow_flight_Flight, 13);
|
|
134
|
+
export const CancelFlightInfoResultSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 13)
|
|
135
|
+
|
|
158
136
|
/**
|
|
159
137
|
* Describes the message arrow.flight.protocol.Ticket.
|
|
160
138
|
* Use `create(TicketSchema)` to create a new message.
|
|
161
139
|
*/
|
|
162
|
-
export const TicketSchema =
|
|
163
|
-
|
|
164
|
-
messageDesc(file_arrow_flight_Flight, 14);
|
|
140
|
+
export const TicketSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 14)
|
|
141
|
+
|
|
165
142
|
/**
|
|
166
143
|
* Describes the message arrow.flight.protocol.Location.
|
|
167
144
|
* Use `create(LocationSchema)` to create a new message.
|
|
168
145
|
*/
|
|
169
|
-
export const LocationSchema =
|
|
170
|
-
|
|
171
|
-
messageDesc(file_arrow_flight_Flight, 15);
|
|
146
|
+
export const LocationSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 15)
|
|
147
|
+
|
|
172
148
|
/**
|
|
173
149
|
* Describes the message arrow.flight.protocol.FlightEndpoint.
|
|
174
150
|
* Use `create(FlightEndpointSchema)` to create a new message.
|
|
175
151
|
*/
|
|
176
|
-
export const FlightEndpointSchema =
|
|
177
|
-
|
|
178
|
-
messageDesc(file_arrow_flight_Flight, 16);
|
|
152
|
+
export const FlightEndpointSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 16)
|
|
153
|
+
|
|
179
154
|
/**
|
|
180
155
|
* Describes the message arrow.flight.protocol.RenewFlightEndpointRequest.
|
|
181
156
|
* Use `create(RenewFlightEndpointRequestSchema)` to create a new message.
|
|
182
157
|
*/
|
|
183
|
-
export const RenewFlightEndpointRequestSchema =
|
|
184
|
-
/*@__PURE__*/
|
|
185
|
-
messageDesc(file_arrow_flight_Flight, 17)
|
|
158
|
+
export const RenewFlightEndpointRequestSchema =
|
|
159
|
+
/*@__PURE__*/
|
|
160
|
+
messageDesc(file_arrow_flight_Flight, 17)
|
|
161
|
+
|
|
186
162
|
/**
|
|
187
163
|
* Describes the message arrow.flight.protocol.FlightData.
|
|
188
164
|
* Use `create(FlightDataSchema)` to create a new message.
|
|
189
165
|
*/
|
|
190
|
-
export const FlightDataSchema =
|
|
191
|
-
|
|
192
|
-
messageDesc(file_arrow_flight_Flight, 18);
|
|
166
|
+
export const FlightDataSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 18)
|
|
167
|
+
|
|
193
168
|
/**
|
|
194
169
|
* Describes the message arrow.flight.protocol.PutResult.
|
|
195
170
|
* Use `create(PutResultSchema)` to create a new message.
|
|
196
171
|
*/
|
|
197
|
-
export const PutResultSchema =
|
|
198
|
-
|
|
199
|
-
messageDesc(file_arrow_flight_Flight, 19);
|
|
172
|
+
export const PutResultSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 19)
|
|
173
|
+
|
|
200
174
|
/**
|
|
201
175
|
* Describes the message arrow.flight.protocol.SessionOptionValue.
|
|
202
176
|
* Use `create(SessionOptionValueSchema)` to create a new message.
|
|
203
177
|
*/
|
|
204
|
-
export const SessionOptionValueSchema =
|
|
205
|
-
|
|
206
|
-
messageDesc(file_arrow_flight_Flight, 20);
|
|
178
|
+
export const SessionOptionValueSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 20)
|
|
179
|
+
|
|
207
180
|
/**
|
|
208
181
|
* Describes the message arrow.flight.protocol.SessionOptionValue.StringListValue.
|
|
209
182
|
* Use `create(SessionOptionValue_StringListValueSchema)` to create a new message.
|
|
210
183
|
*/
|
|
211
|
-
export const SessionOptionValue_StringListValueSchema =
|
|
212
|
-
/*@__PURE__*/
|
|
213
|
-
messageDesc(file_arrow_flight_Flight, 20, 0)
|
|
184
|
+
export const SessionOptionValue_StringListValueSchema =
|
|
185
|
+
/*@__PURE__*/
|
|
186
|
+
messageDesc(file_arrow_flight_Flight, 20, 0)
|
|
187
|
+
|
|
214
188
|
/**
|
|
215
189
|
* Describes the message arrow.flight.protocol.SetSessionOptionsRequest.
|
|
216
190
|
* Use `create(SetSessionOptionsRequestSchema)` to create a new message.
|
|
217
191
|
*/
|
|
218
|
-
export const SetSessionOptionsRequestSchema =
|
|
219
|
-
/*@__PURE__*/
|
|
220
|
-
messageDesc(file_arrow_flight_Flight, 21)
|
|
192
|
+
export const SetSessionOptionsRequestSchema =
|
|
193
|
+
/*@__PURE__*/
|
|
194
|
+
messageDesc(file_arrow_flight_Flight, 21)
|
|
195
|
+
|
|
221
196
|
/**
|
|
222
197
|
* Describes the message arrow.flight.protocol.SetSessionOptionsResult.
|
|
223
198
|
* Use `create(SetSessionOptionsResultSchema)` to create a new message.
|
|
224
199
|
*/
|
|
225
|
-
export const SetSessionOptionsResultSchema =
|
|
226
|
-
|
|
227
|
-
messageDesc(file_arrow_flight_Flight, 22);
|
|
200
|
+
export const SetSessionOptionsResultSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 22)
|
|
201
|
+
|
|
228
202
|
/**
|
|
229
203
|
* Describes the message arrow.flight.protocol.SetSessionOptionsResult.Error.
|
|
230
204
|
* Use `create(SetSessionOptionsResult_ErrorSchema)` to create a new message.
|
|
231
205
|
*/
|
|
232
|
-
export const SetSessionOptionsResult_ErrorSchema =
|
|
233
|
-
/*@__PURE__*/
|
|
234
|
-
messageDesc(file_arrow_flight_Flight, 22, 0)
|
|
206
|
+
export const SetSessionOptionsResult_ErrorSchema =
|
|
207
|
+
/*@__PURE__*/
|
|
208
|
+
messageDesc(file_arrow_flight_Flight, 22, 0)
|
|
209
|
+
|
|
235
210
|
/**
|
|
236
|
-
*
|
|
211
|
+
* Describes the enum arrow.flight.protocol.SetSessionOptionsResult.ErrorValue.
|
|
237
212
|
*/
|
|
238
|
-
export
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
* Servers should avoid using this value. The request may be retried by the client.
|
|
243
|
-
*
|
|
244
|
-
* @generated from enum value: UNSPECIFIED = 0;
|
|
245
|
-
*/
|
|
246
|
-
SetSessionOptionsResult_ErrorValue[SetSessionOptionsResult_ErrorValue["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
247
|
-
/**
|
|
248
|
-
* The given session option name is invalid.
|
|
249
|
-
*
|
|
250
|
-
* @generated from enum value: INVALID_NAME = 1;
|
|
251
|
-
*/
|
|
252
|
-
SetSessionOptionsResult_ErrorValue[SetSessionOptionsResult_ErrorValue["INVALID_NAME"] = 1] = "INVALID_NAME";
|
|
253
|
-
/**
|
|
254
|
-
* The session option value or type is invalid.
|
|
255
|
-
*
|
|
256
|
-
* @generated from enum value: INVALID_VALUE = 2;
|
|
257
|
-
*/
|
|
258
|
-
SetSessionOptionsResult_ErrorValue[SetSessionOptionsResult_ErrorValue["INVALID_VALUE"] = 2] = "INVALID_VALUE";
|
|
259
|
-
/**
|
|
260
|
-
* The session option cannot be set.
|
|
261
|
-
*
|
|
262
|
-
* @generated from enum value: ERROR = 3;
|
|
263
|
-
*/
|
|
264
|
-
SetSessionOptionsResult_ErrorValue[SetSessionOptionsResult_ErrorValue["ERROR"] = 3] = "ERROR";
|
|
265
|
-
})(SetSessionOptionsResult_ErrorValue || (SetSessionOptionsResult_ErrorValue = {}));
|
|
213
|
+
export const SetSessionOptionsResult_ErrorValueSchema =
|
|
214
|
+
/*@__PURE__*/
|
|
215
|
+
enumDesc(file_arrow_flight_Flight, 22, 0)
|
|
216
|
+
|
|
266
217
|
/**
|
|
267
|
-
*
|
|
218
|
+
* @generated from enum arrow.flight.protocol.SetSessionOptionsResult.ErrorValue
|
|
268
219
|
*/
|
|
269
|
-
export const
|
|
270
|
-
/*@__PURE__*/
|
|
271
|
-
|
|
220
|
+
export const SetSessionOptionsResult_ErrorValue =
|
|
221
|
+
/*@__PURE__*/
|
|
222
|
+
tsEnum(SetSessionOptionsResult_ErrorValueSchema)
|
|
223
|
+
|
|
272
224
|
/**
|
|
273
225
|
* Describes the message arrow.flight.protocol.GetSessionOptionsRequest.
|
|
274
226
|
* Use `create(GetSessionOptionsRequestSchema)` to create a new message.
|
|
275
227
|
*/
|
|
276
|
-
export const GetSessionOptionsRequestSchema =
|
|
277
|
-
/*@__PURE__*/
|
|
278
|
-
messageDesc(file_arrow_flight_Flight, 23)
|
|
228
|
+
export const GetSessionOptionsRequestSchema =
|
|
229
|
+
/*@__PURE__*/
|
|
230
|
+
messageDesc(file_arrow_flight_Flight, 23)
|
|
231
|
+
|
|
279
232
|
/**
|
|
280
233
|
* Describes the message arrow.flight.protocol.GetSessionOptionsResult.
|
|
281
234
|
* Use `create(GetSessionOptionsResultSchema)` to create a new message.
|
|
282
235
|
*/
|
|
283
|
-
export const GetSessionOptionsResultSchema =
|
|
284
|
-
|
|
285
|
-
messageDesc(file_arrow_flight_Flight, 24);
|
|
236
|
+
export const GetSessionOptionsResultSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 24)
|
|
237
|
+
|
|
286
238
|
/**
|
|
287
239
|
* Describes the message arrow.flight.protocol.CloseSessionRequest.
|
|
288
240
|
* Use `create(CloseSessionRequestSchema)` to create a new message.
|
|
289
241
|
*/
|
|
290
|
-
export const CloseSessionRequestSchema =
|
|
291
|
-
|
|
292
|
-
messageDesc(file_arrow_flight_Flight, 25);
|
|
242
|
+
export const CloseSessionRequestSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 25)
|
|
243
|
+
|
|
293
244
|
/**
|
|
294
245
|
* Describes the message arrow.flight.protocol.CloseSessionResult.
|
|
295
246
|
* Use `create(CloseSessionResultSchema)` to create a new message.
|
|
296
247
|
*/
|
|
297
|
-
export const CloseSessionResultSchema =
|
|
298
|
-
|
|
299
|
-
|
|
248
|
+
export const CloseSessionResultSchema = /*@__PURE__*/ messageDesc(file_arrow_flight_Flight, 26)
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Describes the enum arrow.flight.protocol.CloseSessionResult.Status.
|
|
252
|
+
*/
|
|
253
|
+
export const CloseSessionResult_StatusSchema =
|
|
254
|
+
/*@__PURE__*/
|
|
255
|
+
enumDesc(file_arrow_flight_Flight, 26, 0)
|
|
256
|
+
|
|
300
257
|
/**
|
|
301
258
|
* @generated from enum arrow.flight.protocol.CloseSessionResult.Status
|
|
302
259
|
*/
|
|
303
|
-
export
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Protobuf deserialization fallback value: The session close status is unknown or
|
|
307
|
-
* not recognized. Servers should avoid using this value (send a NOT_FOUND error if
|
|
308
|
-
* the requested session is not known or expired). Clients can retry the request.
|
|
309
|
-
*
|
|
310
|
-
* @generated from enum value: UNSPECIFIED = 0;
|
|
311
|
-
*/
|
|
312
|
-
CloseSessionResult_Status[CloseSessionResult_Status["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
313
|
-
/**
|
|
314
|
-
* The session close request is complete. Subsequent requests with
|
|
315
|
-
* the same session produce a NOT_FOUND error.
|
|
316
|
-
*
|
|
317
|
-
* @generated from enum value: CLOSED = 1;
|
|
318
|
-
*/
|
|
319
|
-
CloseSessionResult_Status[CloseSessionResult_Status["CLOSED"] = 1] = "CLOSED";
|
|
320
|
-
/**
|
|
321
|
-
* The session close request is in progress. The client may retry
|
|
322
|
-
* the close request.
|
|
323
|
-
*
|
|
324
|
-
* @generated from enum value: CLOSING = 2;
|
|
325
|
-
*/
|
|
326
|
-
CloseSessionResult_Status[CloseSessionResult_Status["CLOSING"] = 2] = "CLOSING";
|
|
327
|
-
/**
|
|
328
|
-
* The session is not closeable. The client should not retry the
|
|
329
|
-
* close request.
|
|
330
|
-
*
|
|
331
|
-
* @generated from enum value: NOT_CLOSEABLE = 3;
|
|
332
|
-
*/
|
|
333
|
-
CloseSessionResult_Status[CloseSessionResult_Status["NOT_CLOSEABLE"] = 3] = "NOT_CLOSEABLE";
|
|
334
|
-
})(CloseSessionResult_Status || (CloseSessionResult_Status = {}));
|
|
260
|
+
export const CloseSessionResult_Status = /*@__PURE__*/ tsEnum(CloseSessionResult_StatusSchema)
|
|
261
|
+
|
|
335
262
|
/**
|
|
336
|
-
* Describes the enum arrow.flight.protocol.
|
|
263
|
+
* Describes the enum arrow.flight.protocol.CancelStatus.
|
|
337
264
|
*/
|
|
338
|
-
export const
|
|
339
|
-
|
|
340
|
-
enumDesc(file_arrow_flight_Flight, 26, 0);
|
|
265
|
+
export const CancelStatusSchema = /*@__PURE__*/ enumDesc(file_arrow_flight_Flight, 0)
|
|
266
|
+
|
|
341
267
|
/**
|
|
342
268
|
*
|
|
343
269
|
* The result of a cancel operation.
|
|
@@ -346,44 +272,8 @@ enumDesc(file_arrow_flight_Flight, 26, 0);
|
|
|
346
272
|
*
|
|
347
273
|
* @generated from enum arrow.flight.protocol.CancelStatus
|
|
348
274
|
*/
|
|
349
|
-
export
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* The cancellation status is unknown. Servers should avoid using
|
|
353
|
-
* this value (send a NOT_FOUND error if the requested query is
|
|
354
|
-
* not known). Clients can retry the request.
|
|
355
|
-
*
|
|
356
|
-
* @generated from enum value: CANCEL_STATUS_UNSPECIFIED = 0;
|
|
357
|
-
*/
|
|
358
|
-
CancelStatus[CancelStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
359
|
-
/**
|
|
360
|
-
* The cancellation request is complete. Subsequent requests with
|
|
361
|
-
* the same payload may return CANCELLED or a NOT_FOUND error.
|
|
362
|
-
*
|
|
363
|
-
* @generated from enum value: CANCEL_STATUS_CANCELLED = 1;
|
|
364
|
-
*/
|
|
365
|
-
CancelStatus[CancelStatus["CANCELLED"] = 1] = "CANCELLED";
|
|
366
|
-
/**
|
|
367
|
-
* The cancellation request is in progress. The client may retry
|
|
368
|
-
* the cancellation request.
|
|
369
|
-
*
|
|
370
|
-
* @generated from enum value: CANCEL_STATUS_CANCELLING = 2;
|
|
371
|
-
*/
|
|
372
|
-
CancelStatus[CancelStatus["CANCELLING"] = 2] = "CANCELLING";
|
|
373
|
-
/**
|
|
374
|
-
* The query is not cancellable. The client should not retry the
|
|
375
|
-
* cancellation request.
|
|
376
|
-
*
|
|
377
|
-
* @generated from enum value: CANCEL_STATUS_NOT_CANCELLABLE = 3;
|
|
378
|
-
*/
|
|
379
|
-
CancelStatus[CancelStatus["NOT_CANCELLABLE"] = 3] = "NOT_CANCELLABLE";
|
|
380
|
-
})(CancelStatus || (CancelStatus = {}));
|
|
381
|
-
/**
|
|
382
|
-
* Describes the enum arrow.flight.protocol.CancelStatus.
|
|
383
|
-
*/
|
|
384
|
-
export const CancelStatusSchema =
|
|
385
|
-
/*@__PURE__*/
|
|
386
|
-
enumDesc(file_arrow_flight_Flight, 0);
|
|
275
|
+
export const CancelStatus = /*@__PURE__*/ tsEnum(CancelStatusSchema)
|
|
276
|
+
|
|
387
277
|
/**
|
|
388
278
|
*
|
|
389
279
|
* A flight service is an endpoint for retrieving or storing Arrow data. A
|
|
@@ -393,5 +283,4 @@ enumDesc(file_arrow_flight_Flight, 0);
|
|
|
393
283
|
*
|
|
394
284
|
* @generated from service arrow.flight.protocol.FlightService
|
|
395
285
|
*/
|
|
396
|
-
export const FlightService = /*@__PURE__*/ serviceDesc(file_arrow_flight_Flight, 0)
|
|
397
|
-
//# sourceMappingURL=Flight_pb.js.map
|
|
286
|
+
export const FlightService = /*@__PURE__*/ serviceDesc(file_arrow_flight_Flight, 0)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlightData builders for constructing test messages.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import { type RecordBatch, type Schema, type Table } from "apache-arrow";
|
|
7
|
+
import { type FlightData } from "../gen/arrow/flight/Flight_pb.js";
|
|
8
|
+
/**
|
|
9
|
+
* Create an empty FlightData message (keep-alive).
|
|
10
|
+
*
|
|
11
|
+
* @returns Empty FlightData message
|
|
12
|
+
*/
|
|
13
|
+
export declare function createEmptyFlightData(): FlightData;
|
|
14
|
+
/**
|
|
15
|
+
* Collect all FlightData messages from an async iterable into an array.
|
|
16
|
+
*
|
|
17
|
+
* Useful for testing stream consumers by materializing the stream.
|
|
18
|
+
*
|
|
19
|
+
* @param stream - Async iterable of FlightData messages
|
|
20
|
+
* @returns Array of FlightData messages
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const table = createTestTable({ id: [1, 2, 3] })
|
|
25
|
+
* const flightData = await collectFlightData(encodeTableToFlightData(table))
|
|
26
|
+
* expect(flightData.length).toBeGreaterThan(0)
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function collectFlightData(stream: AsyncIterable<FlightData>): Promise<FlightData[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Convert an Arrow Table to an array of FlightData messages.
|
|
32
|
+
*
|
|
33
|
+
* Encodes the table as IPC stream format and wraps in FlightData.
|
|
34
|
+
*
|
|
35
|
+
* @param table - Arrow Table to convert
|
|
36
|
+
* @returns Array of FlightData messages
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const table = createTestTable({ id: [1, 2, 3], value: [1.1, 2.2, 3.3] })
|
|
41
|
+
* const flightData = await tableToFlightData(table)
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function tableToFlightData(table: Table): Promise<FlightData[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Convert Arrow RecordBatches to an array of FlightData messages.
|
|
47
|
+
*
|
|
48
|
+
* @param batches - RecordBatches to convert
|
|
49
|
+
* @param schema - Arrow Schema for the data
|
|
50
|
+
* @returns Array of FlightData messages
|
|
51
|
+
*/
|
|
52
|
+
export declare function batchesToFlightData(batches: Iterable<RecordBatch> | RecordBatch[], schema: Schema): FlightData[];
|
|
53
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/testing/builders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,KAAK,WAAW,EAA2B,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,cAAc,CAAA;AAEjG,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,kCAAkC,CAAA;AAEpF;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,UAAU,CAMlD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAQhG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAE3E;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,WAAW,EAAE,EAC9C,MAAM,EAAE,MAAM,GACb,UAAU,EAAE,CAiCd"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlightData builders for constructing test messages.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import { create } from "@bufbuild/protobuf";
|
|
7
|
+
import { RecordBatchStreamWriter } from "apache-arrow";
|
|
8
|
+
import { FlightDataSchema } from "../gen/arrow/flight/Flight_pb.js";
|
|
9
|
+
/**
|
|
10
|
+
* Create an empty FlightData message (keep-alive).
|
|
11
|
+
*
|
|
12
|
+
* @returns Empty FlightData message
|
|
13
|
+
*/
|
|
14
|
+
export function createEmptyFlightData() {
|
|
15
|
+
return create(FlightDataSchema, {
|
|
16
|
+
dataHeader: new Uint8Array(0),
|
|
17
|
+
dataBody: new Uint8Array(0),
|
|
18
|
+
appMetadata: new Uint8Array(0)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Collect all FlightData messages from an async iterable into an array.
|
|
23
|
+
*
|
|
24
|
+
* Useful for testing stream consumers by materializing the stream.
|
|
25
|
+
*
|
|
26
|
+
* @param stream - Async iterable of FlightData messages
|
|
27
|
+
* @returns Array of FlightData messages
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const table = createTestTable({ id: [1, 2, 3] })
|
|
32
|
+
* const flightData = await collectFlightData(encodeTableToFlightData(table))
|
|
33
|
+
* expect(flightData.length).toBeGreaterThan(0)
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export async function collectFlightData(stream) {
|
|
37
|
+
const result = [];
|
|
38
|
+
for await (const data of stream) {
|
|
39
|
+
result.push(data);
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Convert an Arrow Table to an array of FlightData messages.
|
|
45
|
+
*
|
|
46
|
+
* Encodes the table as IPC stream format and wraps in FlightData.
|
|
47
|
+
*
|
|
48
|
+
* @param table - Arrow Table to convert
|
|
49
|
+
* @returns Array of FlightData messages
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const table = createTestTable({ id: [1, 2, 3], value: [1.1, 2.2, 3.3] })
|
|
54
|
+
* const flightData = await tableToFlightData(table)
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export async function tableToFlightData(table) {
|
|
58
|
+
return Promise.resolve(batchesToFlightData(table.batches, table.schema));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Convert Arrow RecordBatches to an array of FlightData messages.
|
|
62
|
+
*
|
|
63
|
+
* @param batches - RecordBatches to convert
|
|
64
|
+
* @param schema - Arrow Schema for the data
|
|
65
|
+
* @returns Array of FlightData messages
|
|
66
|
+
*/
|
|
67
|
+
export function batchesToFlightData(batches, schema) {
|
|
68
|
+
const batchArray = Array.isArray(batches) ? batches : [...batches];
|
|
69
|
+
if (batchArray.length === 0) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
// Create an IPC stream writer and write all batches
|
|
73
|
+
const writer = new RecordBatchStreamWriter();
|
|
74
|
+
writer.reset(undefined, schema);
|
|
75
|
+
for (const batch of batchArray) {
|
|
76
|
+
writer.write(batch);
|
|
77
|
+
}
|
|
78
|
+
writer.finish();
|
|
79
|
+
// Get the complete IPC stream
|
|
80
|
+
const ipcBytes = writer.toUint8Array(true);
|
|
81
|
+
if (ipcBytes.length === 0) {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
// Wrap IPC bytes in FlightData
|
|
85
|
+
// Note: In production, Flight typically splits schema and batches into separate messages.
|
|
86
|
+
// For testing, a single message with the complete IPC stream works.
|
|
87
|
+
return [
|
|
88
|
+
create(FlightDataSchema, {
|
|
89
|
+
dataHeader: ipcBytes,
|
|
90
|
+
dataBody: new Uint8Array(0),
|
|
91
|
+
appMetadata: new Uint8Array(0)
|
|
92
|
+
})
|
|
93
|
+
];
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=builders.js.map
|