fresh-borzoni commented on code in PR #330:
URL: https://github.com/apache/fluss-rust/pull/330#discussion_r2809145535
##########
bindings/cpp/include/fluss.hpp:
##########
@@ -799,48 +608,122 @@ struct GenericRow {
return it->second;
}
- const Datum& GetField(size_t idx) const {
- if (idx >= fields.size()) {
- throw std::runtime_error("GenericRow: index " +
std::to_string(idx) +
- " out of bounds (size=" +
std::to_string(fields.size()) + ")");
- }
- return fields[idx];
- }
+ void Destroy() noexcept;
- const Datum& GetTypedField(size_t idx, DatumType expected) const {
- const auto& d = GetField(idx);
- if (d.GetType() != expected) {
- throw std::runtime_error("GenericRow: field " +
std::to_string(idx) +
- " type mismatch: expected " +
-
std::to_string(static_cast<int>(expected)) + ", got " +
-
std::to_string(static_cast<int>(d.GetType())));
- }
- return d;
- }
+ ffi::GenericRowInner* inner_{nullptr};
+ std::shared_ptr<ColumnMap> column_map_;
+};
- void EnsureSize(size_t idx) {
- if (fields.size() <= idx) {
- fields.resize(idx + 1);
+/// Read-only row view for scan results. Zero-copy access to string and bytes
data.
+///
+/// WARNING: RowView borrows from ScanRecords. It must not outlive the
ScanRecords
+/// that produced it (similar to std::string_view borrowing from std::string).
+class RowView : public detail::NamedGetters<RowView> {
Review Comment:
Yes, I'll tweak docs after this code only PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]