The new KDB-X CSV module infers column types for you, so there’s no need to specify them when loading a file. Read the module reference to explore its other features: https://lnkd.in/eaGf_mQX
KDB-X now has a CSV module 🎉 If you've worked with kdb+ for a while, you probably know 𝘤𝘴𝘷𝘶𝘵𝘪𝘭.𝘲. It's been the go-to for guessing column types in a CSV for years, and it's the base of this module. We rebuilt it as a proper KDB-X module and added the features that can simplify your workflow. The GIF shows a few of them: • .csv.read loads a file and infers the types for you. No type string to write! • 𝘪𝘯𝘧𝘦𝘳 shows what it picked for each column before you load anything, and flags the guesses it isn't sure about. • It reads straight from a URL, and unzips gzip files. • A glob like 𝘵𝘳𝘢𝘥𝘦𝘴/𝘥𝘢𝘺*.𝘤𝘴𝘷 loads many files as one table. The types are inferred once across all of them. • 𝘧𝘳𝘶𝘨𝘢𝘭 narrows floats to reals and longs to shorts when the sampled values fit. That means less memory, with the usual trade-off that a value outside the sample can load as null. • Finance-specific rules: ISINs, CUSIPs and other identifiers with check-digit validation, and bond prices in 32nds (99-16+ becomes 99.5156). There's also a 𝘳𝘦𝘫𝘦𝘤𝘵𝘴 function that lists the values that didn't fit their column's type, and batch loading for files that are too big for memory. If you're coming from 𝘤𝘴𝘷𝘶𝘵𝘪𝘭.𝘲, the reference has a migration table. It's open source and written in q only, so there's nothing to compile: .𝘤𝘴𝘷: 𝘶𝘴𝘦 `kx.csv Feature requests are very welcome. Issues on GitHub or a comment here both work. #kdb #KDBX #csv #opensource #dataengineering