Skip to content

Conversation

@AnasProgrammer2
Copy link

1️⃣ Optimized Table Schema

Changed SrcAddr, DstAddr, and SamplerAddress to IPv4 (previously UInt32).
Changed Proto to UInt8, SrcPort/DstPort to UInt16 (fixed type mismatch errors).
Optimized partitioning to toYYYYMM(TimeReceived) (reduced excessive partitions).
2️⃣ Fixed Data Type Mapping

Ensured correct type conversions for all flow fields before insertion.
Used IPv4 format for IPs and proper UIntX types for other values.
Fixed "unexpected type" errors in ClickHouse inserts.
3️⃣ Added SamplerAddress (Router IP)

Now stores the router IP that sent the flow data (SamplerAddress field).
Allows filtering flows by source router.
4️⃣ Improved Bulk Insert Performance

Used transaction-based batch inserts instead of inserting row-by-row.
Reduced ClickHouse write overhead and improved query speed.
This commit improves stability, compatibility, and performance of the ClickHouse transporter in GoFlow. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant