Spaces:
Sleeping
Sleeping
File size: 24,870 Bytes
be5030f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 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 106 107 108 109 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 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 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
const NS7624605610262437867 = require("./Schema");
var org;
(function (org) {
var apache;
(function (apache) {
var arrow;
(function (arrow) {
var flatbuf;
(function (flatbuf) {
flatbuf.Schema = NS7624605610262437867.org.apache.arrow.flatbuf.Schema;
})(flatbuf = arrow.flatbuf || (arrow.flatbuf = {}));
})(arrow = apache.arrow || (apache.arrow = {}));
})(apache = org.apache || (org.apache = {}));
})(org = exports.org || (exports.org = {}));
/**
* ----------------------------------------------------------------------
* The root Message type
* This union enables us to easily send different message types without
* redundant storage, and in the future we can easily add new message types.
*
* Arrow implementations do not need to implement all of the message types,
* which may include experimental metadata types. For maximum compatibility,
* it is best to send data using RecordBatch
*
* @enum {number}
*/
(function (org) {
var apache;
(function (apache) {
var arrow;
(function (arrow) {
var flatbuf;
(function (flatbuf) {
let MessageHeader;
(function (MessageHeader) {
MessageHeader[MessageHeader["NONE"] = 0] = "NONE";
MessageHeader[MessageHeader["Schema"] = 1] = "Schema";
MessageHeader[MessageHeader["DictionaryBatch"] = 2] = "DictionaryBatch";
MessageHeader[MessageHeader["RecordBatch"] = 3] = "RecordBatch";
MessageHeader[MessageHeader["Tensor"] = 4] = "Tensor";
MessageHeader[MessageHeader["SparseTensor"] = 5] = "SparseTensor";
})(MessageHeader = flatbuf.MessageHeader || (flatbuf.MessageHeader = {}));
})(flatbuf = arrow.flatbuf || (arrow.flatbuf = {}));
})(arrow = apache.arrow || (apache.arrow = {}));
})(apache = org.apache || (org.apache = {}));
})(org = exports.org || (exports.org = {}));
/**
* ----------------------------------------------------------------------
* Data structures for describing a table row batch (a collection of
* equal-length Arrow arrays)
* Metadata about a field at some level of a nested type tree (but not
* its children).
*
* For example, a List<Int16> with values [[1, 2, 3], null, [4], [5, 6], null]
* would have {length: 5, null_count: 2} for its List node, and {length: 6,
* null_count: 0} for its Int16 node, as separate FieldNode structs
*
* @constructor
*/
(function (org) {
var apache;
(function (apache) {
var arrow;
(function (arrow) {
var flatbuf;
(function (flatbuf) {
class FieldNode {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
/**
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns FieldNode
*/
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
/**
* The number of value slots in the Arrow array at this level of a nested
* tree
*
* @returns flatbuffers.Long
*/
length() {
return this.bb.readInt64(this.bb_pos);
}
/**
* The number of observed nulls. Fields with null_count == 0 may choose not
* to write their physical validity bitmap out as a materialized buffer,
* instead setting the length of the bitmap buffer to 0.
*
* @returns flatbuffers.Long
*/
nullCount() {
return this.bb.readInt64(this.bb_pos + 8);
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Long length
* @param flatbuffers.Long null_count
* @returns flatbuffers.Offset
*/
static createFieldNode(builder, length, null_count) {
builder.prep(8, 16);
builder.writeInt64(null_count);
builder.writeInt64(length);
return builder.offset();
}
}
flatbuf.FieldNode = FieldNode;
})(flatbuf = arrow.flatbuf || (arrow.flatbuf = {}));
})(arrow = apache.arrow || (apache.arrow = {}));
})(apache = org.apache || (org.apache = {}));
})(org = exports.org || (exports.org = {}));
/**
* A data header describing the shared memory layout of a "record" or "row"
* batch. Some systems call this a "row batch" internally and others a "record
* batch".
*
* @constructor
*/
(function (org) {
var apache;
(function (apache) {
var arrow;
(function (arrow) {
var flatbuf;
(function (flatbuf) {
class RecordBatch {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
/**
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns RecordBatch
*/
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
/**
* @param flatbuffers.ByteBuffer bb
* @param RecordBatch= obj
* @returns RecordBatch
*/
static getRootAsRecordBatch(bb, obj) {
return (obj || new RecordBatch).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
/**
* number of records / rows. The arrays in the batch should all have this
* length
*
* @returns flatbuffers.Long
*/
length() {
let offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
}
/**
* Nodes correspond to the pre-ordered flattened logical schema
*
* @param number index
* @param org.apache.arrow.flatbuf.FieldNode= obj
* @returns org.apache.arrow.flatbuf.FieldNode
*/
nodes(index, obj) {
let offset = this.bb.__offset(this.bb_pos, 6);
return offset ? (obj || new org.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos + offset) + index * 16, this.bb) : null;
}
/**
* @returns number
*/
nodesLength() {
let offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
}
/**
* Buffers correspond to the pre-ordered flattened buffer tree
*
* The number of buffers appended to this list depends on the schema. For
* example, most primitive arrays will have 2 buffers, 1 for the validity
* bitmap and 1 for the values. For struct arrays, there will only be a
* single buffer for the validity (nulls) bitmap
*
* @param number index
* @param org.apache.arrow.flatbuf.Buffer= obj
* @returns org.apache.arrow.flatbuf.Buffer
*/
buffers(index, obj) {
let offset = this.bb.__offset(this.bb_pos, 8);
return offset ? (obj || new NS7624605610262437867.org.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos + offset) + index * 16, this.bb) : null;
}
/**
* @returns number
*/
buffersLength() {
let offset = this.bb.__offset(this.bb_pos, 8);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
}
/**
* @param flatbuffers.Builder builder
*/
static startRecordBatch(builder) {
builder.startObject(3);
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Long length
*/
static addLength(builder, length) {
builder.addFieldInt64(0, length, builder.createLong(0, 0));
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset nodesOffset
*/
static addNodes(builder, nodesOffset) {
builder.addFieldOffset(1, nodesOffset, 0);
}
/**
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startNodesVector(builder, numElems) {
builder.startVector(16, numElems, 8);
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset buffersOffset
*/
static addBuffers(builder, buffersOffset) {
builder.addFieldOffset(2, buffersOffset, 0);
}
/**
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startBuffersVector(builder, numElems) {
builder.startVector(16, numElems, 8);
}
/**
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endRecordBatch(builder) {
let offset = builder.endObject();
return offset;
}
static createRecordBatch(builder, length, nodesOffset, buffersOffset) {
RecordBatch.startRecordBatch(builder);
RecordBatch.addLength(builder, length);
RecordBatch.addNodes(builder, nodesOffset);
RecordBatch.addBuffers(builder, buffersOffset);
return RecordBatch.endRecordBatch(builder);
}
}
flatbuf.RecordBatch = RecordBatch;
})(flatbuf = arrow.flatbuf || (arrow.flatbuf = {}));
})(arrow = apache.arrow || (apache.arrow = {}));
})(apache = org.apache || (org.apache = {}));
})(org = exports.org || (exports.org = {}));
/**
* For sending dictionary encoding information. Any Field can be
* dictionary-encoded, but in this case none of its children may be
* dictionary-encoded.
* There is one vector / column per dictionary, but that vector / column
* may be spread across multiple dictionary batches by using the isDelta
* flag
*
* @constructor
*/
(function (org) {
var apache;
(function (apache) {
var arrow;
(function (arrow) {
var flatbuf;
(function (flatbuf) {
class DictionaryBatch {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
/**
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns DictionaryBatch
*/
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
/**
* @param flatbuffers.ByteBuffer bb
* @param DictionaryBatch= obj
* @returns DictionaryBatch
*/
static getRootAsDictionaryBatch(bb, obj) {
return (obj || new DictionaryBatch).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
/**
* @returns flatbuffers.Long
*/
id() {
let offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
}
/**
* @param org.apache.arrow.flatbuf.RecordBatch= obj
* @returns org.apache.arrow.flatbuf.RecordBatch|null
*/
data(obj) {
let offset = this.bb.__offset(this.bb_pos, 6);
return offset ? (obj || new org.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
}
/**
* If isDelta is true the values in the dictionary are to be appended to a
* dictionary with the indicated id
*
* @returns boolean
*/
isDelta() {
let offset = this.bb.__offset(this.bb_pos, 8);
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
}
/**
* @param flatbuffers.Builder builder
*/
static startDictionaryBatch(builder) {
builder.startObject(3);
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Long id
*/
static addId(builder, id) {
builder.addFieldInt64(0, id, builder.createLong(0, 0));
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset dataOffset
*/
static addData(builder, dataOffset) {
builder.addFieldOffset(1, dataOffset, 0);
}
/**
* @param flatbuffers.Builder builder
* @param boolean isDelta
*/
static addIsDelta(builder, isDelta) {
builder.addFieldInt8(2, +isDelta, +false);
}
/**
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endDictionaryBatch(builder) {
let offset = builder.endObject();
return offset;
}
static createDictionaryBatch(builder, id, dataOffset, isDelta) {
DictionaryBatch.startDictionaryBatch(builder);
DictionaryBatch.addId(builder, id);
DictionaryBatch.addData(builder, dataOffset);
DictionaryBatch.addIsDelta(builder, isDelta);
return DictionaryBatch.endDictionaryBatch(builder);
}
}
flatbuf.DictionaryBatch = DictionaryBatch;
})(flatbuf = arrow.flatbuf || (arrow.flatbuf = {}));
})(arrow = apache.arrow || (apache.arrow = {}));
})(apache = org.apache || (org.apache = {}));
})(org = exports.org || (exports.org = {}));
/**
* @constructor
*/
(function (org) {
var apache;
(function (apache) {
var arrow;
(function (arrow) {
var flatbuf;
(function (flatbuf) {
class Message {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
/**
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Message
*/
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
/**
* @param flatbuffers.ByteBuffer bb
* @param Message= obj
* @returns Message
*/
static getRootAsMessage(bb, obj) {
return (obj || new Message).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
/**
* @returns org.apache.arrow.flatbuf.MetadataVersion
*/
version() {
let offset = this.bb.__offset(this.bb_pos, 4);
return offset ? /** */ (this.bb.readInt16(this.bb_pos + offset)) : NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion.V1;
}
/**
* @returns org.apache.arrow.flatbuf.MessageHeader
*/
headerType() {
let offset = this.bb.__offset(this.bb_pos, 6);
return offset ? /** */ (this.bb.readUint8(this.bb_pos + offset)) : org.apache.arrow.flatbuf.MessageHeader.NONE;
}
/**
* @param flatbuffers.Table obj
* @returns ?flatbuffers.Table
*/
header(obj) {
let offset = this.bb.__offset(this.bb_pos, 8);
return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
}
/**
* @returns flatbuffers.Long
*/
bodyLength() {
let offset = this.bb.__offset(this.bb_pos, 10);
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
}
/**
* @param number index
* @param org.apache.arrow.flatbuf.KeyValue= obj
* @returns org.apache.arrow.flatbuf.KeyValue
*/
customMetadata(index, obj) {
let offset = this.bb.__offset(this.bb_pos, 12);
return offset ? (obj || new NS7624605610262437867.org.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
}
/**
* @returns number
*/
customMetadataLength() {
let offset = this.bb.__offset(this.bb_pos, 12);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
}
/**
* @param flatbuffers.Builder builder
*/
static startMessage(builder) {
builder.startObject(5);
}
/**
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.MetadataVersion version
*/
static addVersion(builder, version) {
builder.addFieldInt16(0, version, NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion.V1);
}
/**
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.MessageHeader headerType
*/
static addHeaderType(builder, headerType) {
builder.addFieldInt8(1, headerType, org.apache.arrow.flatbuf.MessageHeader.NONE);
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset headerOffset
*/
static addHeader(builder, headerOffset) {
builder.addFieldOffset(2, headerOffset, 0);
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Long bodyLength
*/
static addBodyLength(builder, bodyLength) {
builder.addFieldInt64(3, bodyLength, builder.createLong(0, 0));
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset customMetadataOffset
*/
static addCustomMetadata(builder, customMetadataOffset) {
builder.addFieldOffset(4, customMetadataOffset, 0);
}
/**
* @param flatbuffers.Builder builder
* @param Array.<flatbuffers.Offset> data
* @returns flatbuffers.Offset
*/
static createCustomMetadataVector(builder, data) {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addOffset(data[i]);
}
return builder.endVector();
}
/**
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startCustomMetadataVector(builder, numElems) {
builder.startVector(4, numElems, 4);
}
/**
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endMessage(builder) {
let offset = builder.endObject();
return offset;
}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishMessageBuffer(builder, offset) {
builder.finish(offset);
}
static createMessage(builder, version, headerType, headerOffset, bodyLength, customMetadataOffset) {
Message.startMessage(builder);
Message.addVersion(builder, version);
Message.addHeaderType(builder, headerType);
Message.addHeader(builder, headerOffset);
Message.addBodyLength(builder, bodyLength);
Message.addCustomMetadata(builder, customMetadataOffset);
return Message.endMessage(builder);
}
}
flatbuf.Message = Message;
})(flatbuf = arrow.flatbuf || (arrow.flatbuf = {}));
})(arrow = apache.arrow || (apache.arrow = {}));
})(apache = org.apache || (org.apache = {}));
})(org = exports.org || (exports.org = {}));
//# sourceMappingURL=Message.js.map
|