private static List<Column> parseCreateTable(String sql) throws Exception {

        List<Column> columns = new ArrayList<>();
        BufferedReader reader = new BufferedReader(new StringReader(sql));

        Pattern linePattern = Pattern.compile("\\`?([\\w_]+)\\`?\\s+(.+)");
        int columnCount = 0;
        for (String line : reader.lines().collect(Collectors.toList())) {
            line = line.trim();
            if (line.startsWith("CREATE TABLE") || line.startsWith("CREATE TEMPORARY TABLE") || line.trim().startsWith("--")) {
                continue; // Skip the CREATE TABLE line
            }
            if (line.startsWith(")")) {
                break; // End of column definitions
            }
            if (line.endsWith(",")) {
                line = line.substring(0, line.length() - 1); // Remove trailing comma
            }

            // Regex to match column definitions
            Matcher lineMatcher = linePattern.matcher(line);
            if (lineMatcher.find()) {
                String colName = lineMatcher.group(1).trim();
                String colType = lineMatcher.group(2).trim();
                Column col = new Column("col" + (columnCount++), colType);
                columns.add(col);
                System.out.println(colName + " -> " + col.name + ", Type: " + colType);
            }
        }

        return columns;
    }
Formatter for the DateTime type with nanoseconds.
performance/src/main/java/com/clickhouse/benchmark/data/DataSetGenerator.java