MCPcopy Create free account
hub / github.com/bytedance/bolt / validate

Method validate

bolt/vector/FlatVector.cpp:431–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429// the string buffers.
430template <>
431void FlatVector<StringView>::validate(
432 const VectorValidateOptions& options) const {
433 SimpleVector<StringView>::validate(options);
434 auto byteSize = BaseVector::byteSize<StringView>(BaseVector::size());
435 if (byteSize == 0) {
436 return;
437 }
438 BOLT_CHECK_NOT_NULL(values_);
439 BOLT_CHECK_GE(values_->size(), byteSize);
440 auto rawValues = values_->as<StringView>();
441
442 for (auto i = 0; i < BaseVector::length_; ++i) {
443 if (isNullAt(i)) {
444 continue;
445 }
446 auto stringView = rawValues[i];
447 if (!stringView.isInline()) {
448 bool isValid = false;
449 for (const auto& buffer : stringBuffers_) {
450 auto start = buffer->as<char>();
451 if (stringView.data() >= start &&
452 stringView.data() < start + buffer->size()) {
453 isValid = true;
454 break;
455 }
456 }
457 BOLT_CHECK(
458 isValid,
459 "String view at idx {} points outside of the string buffers",
460 i)
461 }
462 }
463}
464
465template <>
466uint64_t FlatVector<StringView>::estimateExportArrowSize() const {

Callers

nothing calls this directly

Calls 6

sizeFunction · 0.85
isInlineMethod · 0.80
isNullAtFunction · 0.70
validateFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected