| 32 | }; |
| 33 | |
| 34 | static offset_t internalTableFunc(const TableFuncMorsel& /*morsel*/, const TableFuncInput& input, |
| 35 | DataChunk& output) { |
| 36 | const auto bindData = input.bindData->constPtrCast<StatsInfoBindData>(); |
| 37 | const auto table = bindData->table; |
| 38 | switch (table->getTableType()) { |
| 39 | case TableType::NODE: { |
| 40 | const auto& nodeTable = table->cast<storage::NodeTable>(); |
| 41 | const auto stats = nodeTable.getStats(transaction::Transaction::Get(*bindData->context)); |
| 42 | output.getValueVectorMutable(0).setValue<cardinality_t>(0, stats.getTableCard()); |
| 43 | for (auto i = 0u; i < nodeTable.getNumColumns(); ++i) { |
| 44 | output.getValueVectorMutable(i + 1).setValue(0, stats.getNumDistinctValues(i)); |
| 45 | } |
| 46 | } break; |
| 47 | default: { |
| 48 | UNREACHABLE_CODE; |
| 49 | } |
| 50 | } |
| 51 | return 1; |
| 52 | } |
| 53 | |
| 54 | static std::unique_ptr<TableFuncBindData> bindFunc(const ClientContext* context, |
| 55 | const TableFuncBindInput* input) { |
nothing calls this directly
no test coverage detected