#include "config.h" #if USE_H3 #include #include #include #include #include #include #include #include #include #include #include #include namespace DB { namespace { class FunctionH3GetRes0Indexes final : public IFunction { public: static constexpr auto name = "h3GetRes0Indexes"; static FunctionPtr create(ContextPtr) { return std::make_shared(); } std::string getName() const override { return name; } size_t getNumberOfArguments() const override { return 0; } bool useDefaultImplementationForConstants() const override { return true; } bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return false; } DataTypePtr getReturnTypeImpl(const DataTypes & /*arguments*/) const override { return std::make_shared(std::make_shared()); } ColumnPtr executeImpl(const ColumnsWithTypeAndName &, const DataTypePtr & result_type, size_t input_rows_count) const override { if (input_rows_count == 0) return result_type->createColumn(); std::vector res0_indexes; const auto cell_count = res0CellCount(); res0_indexes.resize(cell_count); getRes0Cells(res0_indexes.data()); Array res_indexes; res_indexes.insert(res_indexes.end(), res0_indexes.begin(), res0_indexes.end()); return result_type->createColumnConst(input_rows_count, res_indexes); } }; } REGISTER_FUNCTION(H3GetRes0Indexes) { factory.registerFunction(); } } #endif