You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/08/09 08:42:23 UTC

[GitHub] [ignite-3] ibessonov commented on a diff in pull request #988: IGNITE-17400 Basic C++ binary tuple support

ibessonov commented on code in PR #988:
URL: https://github.com/apache/ignite-3/pull/988#discussion_r941030363


##########
modules/platforms/cpp/CMakeLists.txt:
##########
@@ -0,0 +1,41 @@
+#

Review Comment:
   Two general questions:
   - Is this a common practice to use `*.txt` files for CMake? I never used it, but it looks weird to me.
   - `platforms` modules should probably contain code related to thin clients. I'd rather have a different module for this code to be honest.



##########
modules/platforms/cpp/schema/BinaryTupleBuilder.cpp:
##########
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "BinaryTupleBuilder.h"
+#include "BinaryTupleParser.h"
+
+#include <stdexcept>
+
+namespace ignite {
+
+BinaryTupleBuilder::BinaryTupleBuilder(IntT elementCount) noexcept
+    : elementCount(elementCount) {
+}
+
+void BinaryTupleBuilder::start() noexcept {
+    elementIndex = 0;
+    nullElements = 0;
+    valueAreaSize = 0;
+    entrySize = 0;
+}
+
+void BinaryTupleBuilder::layout() {
+    assert(elementIndex == elementCount);
+
+    BinaryTupleHeader header;
+
+    size_t nullmapSize = 0;
+    if (nullElements) {
+        header.setNullMapFlag();
+        nullmapSize = BinaryTupleSchema::getNullMapSize(elementCount);
+    }
+
+    entrySize = header.setVarLenEntrySize(valueAreaSize);
+
+    std::size_t tableSize = entrySize * elementCount;
+
+    binaryTuple.clear();
+    binaryTuple.resize(BinaryTupleHeader::SIZE + nullmapSize + tableSize + valueAreaSize);
+
+    binaryTuple[0] = header.flags;
+
+    nextEntry = binaryTuple.data() + BinaryTupleHeader::SIZE + nullmapSize;
+    valueBase = nextEntry + tableSize;
+    nextValue = valueBase;
+
+    elementIndex = 0;
+}
+
+SizeT BinaryTupleBuilder::sizeOf(DATA_TYPE type, BytesView bytes) {
+    switch (type) {
+        case DATA_TYPE::INT8:
+            return sizeOfInt8(BinaryTupleParser::getInt8(bytes));
+        case DATA_TYPE::INT16:
+            return sizeOfInt16(BinaryTupleParser::getInt16(bytes));
+        case DATA_TYPE::INT32:
+            return sizeOfInt32(BinaryTupleParser::getInt32(bytes));
+        case DATA_TYPE::INT64:
+            return sizeOfInt64(BinaryTupleParser::getInt64(bytes));
+        case DATA_TYPE::FLOAT:
+            return sizeOfFloat(BinaryTupleParser::getFloat(bytes));
+        case DATA_TYPE::DOUBLE:
+            return sizeOfDouble(BinaryTupleParser::getDouble(bytes));
+        case DATA_TYPE::STRING:
+        case DATA_TYPE::BINARY:
+            return bytes.size();
+
+        case DATA_TYPE::UUID:
+        case DATA_TYPE::DATE:
+        case DATA_TYPE::TIME:
+        case DATA_TYPE::DATETIME:
+        case DATA_TYPE::TIMESTAMP:
+        case DATA_TYPE::BITMASK:
+        case DATA_TYPE::NUMBER:
+        case DATA_TYPE::DECIMAL:
+        default:
+            throw std::logic_error("Unsupported type " + std::to_string(static_cast<int>(type)));
+    }
+}
+
+void BinaryTupleBuilder::putBytes(BytesView bytes) {
+    assert(elementIndex < elementCount);
+    assert(nextValue + bytes.size() <= valueBase + valueAreaSize);
+    std::memcpy(nextValue, bytes.data(), bytes.size());
+    nextValue += bytes.size();
+    appendEntry();
+}
+
+void BinaryTupleBuilder::putInt8(BytesView bytes) {
+    SizeT size = sizeOfInt8(BinaryTupleParser::getInt8(bytes));
+    assert(size <= bytes.size());
+    putBytes(BytesView{bytes.data(), size});
+}
+
+void BinaryTupleBuilder::putInt16(BytesView bytes) {
+    SizeT size = sizeOfInt16(BinaryTupleParser::getInt16(bytes));
+    assert(size <= bytes.size());
+    static_assert(BYTE_ORDER == LITTLE_ENDIAN);
+    putBytes(BytesView{bytes.data(), size});
+}
+
+void BinaryTupleBuilder::putInt32(BytesView bytes) {
+    SizeT size = sizeOfInt32(BinaryTupleParser::getInt32(bytes));
+    assert(size <= bytes.size());
+    static_assert(BYTE_ORDER == LITTLE_ENDIAN);
+    putBytes(BytesView{bytes.data(), size});
+}
+
+void BinaryTupleBuilder::putInt64(BytesView bytes) {
+    SizeT size = sizeOfInt64(BinaryTupleParser::getInt64(bytes));
+    assert(size <= bytes.size());
+    static_assert(BYTE_ORDER == LITTLE_ENDIAN);
+    putBytes(BytesView{bytes.data(), size});
+}
+
+void BinaryTupleBuilder::putFloat(BytesView bytes) {
+    SizeT size = sizeOfFloat(BinaryTupleParser::getFloat(bytes));
+    assert(size <= bytes.size());
+    putBytes(BytesView{bytes.data(), size});
+}
+
+void BinaryTupleBuilder::putDouble(BytesView bytes) {
+    double value = BinaryTupleParser::getDouble(bytes);
+    SizeT size = sizeOfDouble(value);
+    assert(size <= bytes.size());
+    if (size != sizeof(float)) {
+        putBytes(BytesView{bytes.data(), size});
+    } else {
+        float floatValue = value;
+        putBytes(BytesView{reinterpret_cast<std::byte*>(&floatValue), sizeof(float)});
+    }
+}
+
+void BinaryTupleBuilder::append(DATA_TYPE type, const BytesView &bytes) {
+    switch (type) {
+        case DATA_TYPE::INT8:
+            return putInt8(bytes);
+        case DATA_TYPE::INT16:
+            return putInt16(bytes);
+        case DATA_TYPE::INT32:
+            return putInt32(bytes);
+        case DATA_TYPE::INT64:
+            return putInt64(bytes);
+        case DATA_TYPE::FLOAT:
+            return putFloat(bytes);
+        case DATA_TYPE::DOUBLE:
+            return putDouble(bytes);
+        case DATA_TYPE::STRING:
+        case DATA_TYPE::BINARY:
+            return putBytes(bytes);
+
+        case DATA_TYPE::UUID:
+        case DATA_TYPE::DATE:
+        case DATA_TYPE::TIME:
+        case DATA_TYPE::DATETIME:
+        case DATA_TYPE::TIMESTAMP:
+        case DATA_TYPE::BITMASK:
+        case DATA_TYPE::NUMBER:
+        case DATA_TYPE::DECIMAL:
+        default:
+            throw std::logic_error("Unsupported type " + std::to_string(static_cast<int>(type)));

Review Comment:
   Do we need a TODO here? Why are they unsupported?



##########
modules/platforms/cpp/schema/BinaryTupleBuilder.h:
##########
@@ -0,0 +1,378 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "BinaryTupleSchema.h"
+#include "common/Types.h"
+
+#include <cassert>
+#include <cstring>
+
+namespace ignite {
+
+/**
+ * @brief Binary tuple builder.
+ *
+ * A tuple builder is used to create one or more binary tuples for a given schema.
+ *
+ * Building a tuple takes two passes. On the first pass the builder finds the tuple
+ * layout. On the second pass it actually fills the tuple data.
+ *
+ * More precisely a tuple is built with the following call sequence:
+ *
+ * 1. Initialize the builder with the @ref start call.
+ * 2. Supply all elements with one or more @ref claim calls in the order that
+ *    corresponds to the tuple schema.
+ * 3. Determine tuple layout with the @ref layout call.
+ * 4. Supply all elements again with one or more @ref append calls in the same
+ *    order with the same values.
+ * 5. Finally, the resulting binary tuple is obtained with the @ref build call.
+ */
+class BinaryTupleBuilder {
+    IntT elementCount; /**< Total number of elements. */
+
+    IntT elementIndex; /**< Index of the next element to add. */
+
+    IntT nullElements; /**< The number of null elements. */
+
+    SizeT valueAreaSize; /**< Total size of all values. */
+
+    SizeT entrySize; /**< Size of an offset table entry. */
+
+    std::byte *nextEntry; /**< Position for the next offset table entry. */
+
+    std::byte *valueBase; /**< Position of the value area.*/
+
+    std::byte *nextValue; /**< Position for the next value. */
+
+    std::vector<std::byte> binaryTuple; /**< Internal buffer for tuple generation. */
+
+public:
+    /**
+     * @brief constructs a new Tuple Builder object
+     *
+     * @param schema Binary tuple schema.
+     */
+    explicit BinaryTupleBuilder(IntT elementCount) noexcept;
+
+    /**
+     * @brief starts a new tuple
+     */
+    void start() noexcept;
+
+    /**
+     * @brief assigns a null value for the next element
+     */
+    void claim(std::nullopt_t /*null*/) noexcept {
+        assert(elementIndex < elementCount);
+        nullElements++;
+        elementIndex++;
+    }
+
+    /**
+     * @brief assigns a binary value for the next element
+     *
+     * @param valueSize required size for the value
+     */
+    void claim(SizeT valueSize) noexcept {
+        assert(elementIndex < elementCount);
+        valueAreaSize += valueSize;
+        elementIndex++;
+    }
+
+    /**
+     * @brief assigns a binary value for the next element
+     *
+     * @param type Element type.
+     * @param bytes Binary element value.
+     */
+    void claim(DATA_TYPE type, const BytesView &bytes) noexcept {
+        claim(sizeOf(type, bytes));
+    }
+
+    /**
+     * @brief assigns a value or null for the next element
+     *
+     * @tparam BytesT Byte container for a single internal tuple field.
+     * @param type Element type.
+     * @param slice Optional value of an internal tuple field.
+     */
+    template <typename BytesT>
+    void claim(DATA_TYPE type, const std::optional<BytesT> &slice) noexcept {
+        if (slice.has_value()) {
+            claim(type, slice.value());
+        } else {
+            claim(std::nullopt);
+        }
+    }
+
+    /**
+     * @brief assigns values for a number of elements
+     *
+     * @tparam BytesT Byte container for a single internal tuple field.
+     * @param schema Tuple schema.
+     * @param tuple Tuple in the internal form.
+     */
+    template <typename BytesT>
+    void claim(const BinaryTupleSchema &schema, const std::vector<std::optional<BytesT>> &tuple) noexcept {
+        for (IntT i = 0; i < schema.numElements(); i++) {
+            claim(schema.getElement(i).dataType, tuple[i]);
+        }
+    }
+
+    /**
+     * @brief performs binary tuple layout
+     */
+    void layout();
+
+    /**
+     * @brief appends a null value for the next element
+     */
+    void append(std::nullopt_t /*null*/) {
+        assert(nullElements > 0);
+        assert(elementIndex < elementCount);
+        binaryTuple[BinaryTupleSchema::getNullOffset(elementIndex)] |= BinaryTupleSchema::getNullMask(elementIndex);
+        appendEntry();
+    }
+
+    /**
+     * @brief appends a value for the next element
+     *
+     * @param type Element type.
+     * @param value Value of an internal tuple field.
+     */
+    void append(DATA_TYPE type, const BytesView &bytes);
+
+    /**
+     * @brief appends a value or null for the next element
+     *
+     * @tparam BytesT Byte container for a single internal tuple field.
+     * @param type Element type.
+     * @param slice Optional value of an internal tuple field.
+     */
+    template <typename BytesT>
+    void append(DATA_TYPE type, const std::optional<BytesT> &slice) {
+        if (slice.has_value()) {
+            append(type, slice.value());
+        } else {
+            append(std::nullopt);
+        }
+    }
+
+    /**
+     * @brief appends values for a number of elements
+     *
+     * @tparam BytesT Byte container for a single internal tuple field.
+     * @param schema Tuple schema.
+     * @param tuple Tuple in the internal form.
+     */
+    template <typename BytesT>
+    void append(const BinaryTupleSchema &schema, const std::vector<std::optional<BytesT>> &tuple) {
+        for (IntT i = 0; i < schema.numElements(); i++) {
+            append(schema.getElement(i).dataType, tuple[i]);
+        }
+    }
+
+    /**
+     * @brief finalizes and returns a binary tuple
+     *
+     * @return Byte buffer with binary tuple.
+     */
+    const std::vector<std::byte> &build() {
+        assert(elementIndex == elementCount);
+        return binaryTuple;
+    }
+
+    /**
+     * @brief builds a binary tuple from an internal tuple representation
+     *
+     * @tparam BytesT Byte container for a single internal tuple field.
+     * @param schema Tuple schema.
+     * @param tuple Tuple in the internal form.
+     * @return Byte buffer with binary tuple.
+     */
+    template <typename BytesT>
+    const std::vector<std::byte> &build(const BinaryTupleSchema &schema, const std::vector<std::optional<BytesT>> &tuple) {
+        start();
+        claim(schema, tuple);
+        layout();
+        append(schema, tuple);
+        return build();
+    }
+
+private:
+    /**
+     * @brief computes required binary size for a given value
+     *
+     * @param value Actual element value.
+     * @return Required size.
+     */
+    static SizeT sizeOfInt8(std::int8_t value) noexcept {
+        return value == 0 ? 0 : sizeof(std::int8_t);
+    }
+
+    /**
+     * @brief computes required binary size for a given value
+     *
+     * @param value Actual element value.
+     * @return Required size.
+     */
+    static SizeT sizeOfInt16(std::int16_t value) noexcept {
+        if (std::uint16_t(value) <= UINT8_MAX) {
+            return sizeOfInt8(std::int8_t(value));
+        }
+        return sizeof(std::int16_t);
+    }
+
+    /**
+     * @brief computes required binary size for a given value
+     *
+     * @param value Actual element value.
+     * @return Required size.
+     */
+    static SizeT sizeOfInt32(std::int32_t value) noexcept {
+        if (std::uint32_t(value) <= UINT8_MAX) {
+            return sizeOfInt8(std::int8_t(value));
+        }
+        if (std::uint32_t(value) <= UINT16_MAX) {
+            return sizeof(std::int16_t);
+        }
+        return sizeof(std::int32_t);
+    }
+
+    /**
+     * @brief computes required binary size for a given value
+     *
+     * @param value Actual element value.
+     * @return Required size.
+     */
+    static SizeT sizeOfInt64(std::int64_t value) noexcept {
+        if (std::uint64_t(value) <= UINT16_MAX) {

Review Comment:
   How does this work? In Java code I see:
   ```        
   if (Short.MIN_VALUE <= value && value <= Short.MAX_VALUE) {
       return appendShort((short) value);
   }
   ```
   But here I see a conversion to unsigned type. I really doubt that `std::uint64_t` returns an absolute value, or does it? If it does, then I'd rather see an explicit `abs` call. If it doesn't, then this code doesn't seem safe, or even correct at all.



##########
modules/platforms/cpp/pom.xml:
##########
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--
+    POM file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.ignite</groupId>
+        <artifactId>ignite-parent</artifactId>
+        <version>1</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>ignite-cpp</artifactId>
+    <version>3.0.0-SNAPSHOT</version>
+
+    <profiles>
+        <!--
+            This profile is used to run cmake build during maven build and store the result in target/cpp directory.
+        -->
+        <profile>
+            <id>build-cpp</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.googlecode.cmake-maven-project</groupId>
+                        <artifactId>cmake-maven-plugin</artifactId>
+                        <configuration>
+                            <downloadBinaries>false</downloadBinaries>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>cmake-generate</id>
+                                <phase>generate-resources</phase>
+                                <goals>
+                                    <goal>generate</goal>
+                                </goals>
+                                <configuration>
+                                    <sourcePath>${project.basedir}</sourcePath>
+                                    <targetPath>${project.build.directory}/cpp</targetPath>
+                                    <generator>Unix Makefiles</generator>
+                                    <options>
+                                        <option>-DCMAKE_BUILD_TYPE=Release</option>
+                                    </options>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>cmake-build</id>
+                                <phase>generate-resources</phase>
+                                <goals>
+                                    <goal>compile</goal>
+                                </goals>
+                                <configuration>
+                                    <projectDirectory>${project.build.directory}/cpp</projectDirectory>
+                                    <options>
+                                        <option>-j</option>
+                                    </options>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-native-library</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/classes/</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${project.build.directory}/cpp/</directory>
+                                    <includes>
+                                        <include>**/*.so</include>

Review Comment:
   Two sets of questions here as well:
   - Do we only support `.so` binaries? Why not include `.dll`? Has this been discussed?
   - Usually binaries go to specific folders for specific architectures. Is this the case here? Has the list of supported architectures been discussed? 



##########
modules/platforms/cpp/schema/BinaryTupleParser.h:
##########
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "BinaryTupleSchema.h"
+#include "common/Types.h"
+
+namespace ignite {
+
+/**
+ * @brief Binary tuple parser.
+ *
+ * A tuple parser is used to parse a binary tuple with a given schema.
+ */
+class BinaryTupleParser {
+    BytesView binaryTuple; /**< The binary tuple to parse. */
+
+    IntT elementCount; /**< Total number of elements. */
+
+    IntT elementIndex; /**< Index of the next element to parse. */
+
+    bool hasNullmap; /**< Flag that indicates if the tuple contains a nullmap. */
+
+    unsigned int entrySize; /**< Size of an offset table entry. */

Review Comment:
   Why not `SizeT`?



##########
modules/platforms/cpp/schema/BinaryTupleBuilder.h:
##########
@@ -0,0 +1,378 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "BinaryTupleSchema.h"
+#include "common/Types.h"
+
+#include <cassert>
+#include <cstring>
+
+namespace ignite {
+
+/**
+ * @brief Binary tuple builder.
+ *
+ * A tuple builder is used to create one or more binary tuples for a given schema.
+ *
+ * Building a tuple takes two passes. On the first pass the builder finds the tuple
+ * layout. On the second pass it actually fills the tuple data.
+ *
+ * More precisely a tuple is built with the following call sequence:
+ *
+ * 1. Initialize the builder with the @ref start call.
+ * 2. Supply all elements with one or more @ref claim calls in the order that
+ *    corresponds to the tuple schema.
+ * 3. Determine tuple layout with the @ref layout call.
+ * 4. Supply all elements again with one or more @ref append calls in the same
+ *    order with the same values.
+ * 5. Finally, the resulting binary tuple is obtained with the @ref build call.
+ */
+class BinaryTupleBuilder {
+    IntT elementCount; /**< Total number of elements. */
+
+    IntT elementIndex; /**< Index of the next element to add. */
+
+    IntT nullElements; /**< The number of null elements. */
+
+    SizeT valueAreaSize; /**< Total size of all values. */
+
+    SizeT entrySize; /**< Size of an offset table entry. */
+
+    std::byte *nextEntry; /**< Position for the next offset table entry. */
+
+    std::byte *valueBase; /**< Position of the value area.*/
+
+    std::byte *nextValue; /**< Position for the next value. */
+
+    std::vector<std::byte> binaryTuple; /**< Internal buffer for tuple generation. */
+
+public:
+    /**
+     * @brief constructs a new Tuple Builder object
+     *
+     * @param schema Binary tuple schema.
+     */
+    explicit BinaryTupleBuilder(IntT elementCount) noexcept;
+
+    /**
+     * @brief starts a new tuple
+     */
+    void start() noexcept;
+
+    /**
+     * @brief assigns a null value for the next element
+     */
+    void claim(std::nullopt_t /*null*/) noexcept {

Review Comment:
   Right now the convention is very non-intuitive: sometimes you have implementation in a proper `cpp` file and sometimes it is in the `.h` file. Is there a rule here? I don't get it.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org