Python's pandas library essentially does this when creating a DataFrame object from a CSV file. Of course, it's not always correct, but may be a starting point for your use case.
i used pandas, type guess isn't nice. especially on some string or time types. also extend pandas types is hard, pandas's design is more like a numerical computation tool.
If you happen to be looking for something in java, you can try: https://github.com/deephaven/deephaven-csv
Benchmarks, along with other java alternatives discussed here: https://deephaven.io/blog/2022/02/23/csv-reader/