public static void main(String[] args) throws IOException {

        String inputSQL = null;
        int rows = 10;
        String datasetName = "dataset_" + System.currentTimeMillis();
        // Simple command-line parsing
        for (int i = 0; i < args.length; i++) {
            switch (args[i]) {
                case "-input":
                    if (i + 1 < args.length) {
                        inputSQL = args[++i];
                    }
                    break;
                case "-rows":
                    if (i + 1 < args.length) {
                        rows = Integer.parseInt(args[++i]);
                    }
                    break;
                case "-name":
                    if (i + 1 < args.length) {
                        datasetName = args[++i];
                    }
                    break;
                default:
                    // Ignore unknown flags
                    break;
            }
        }

        if (inputSQL == null) {
            System.out.println("Error: No original Create Statement was provided.");
            return;
        }

        try {
            Path path = Paths.get(inputSQL);
            System.out.println("SQL file path: " + path + " cwd: " + System.getProperty("user.dir"));
            inputSQL = new String(Files.readAllBytes(path));
        }catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("Dataset name: " + datasetName);

        // Parse the SQL create table statement
        List<Column> originalColumns;
        try {
            originalColumns = parseCreateTable(inputSQL);
        } catch (Exception e) {
            System.out.println("Error parsing SQL: " + e.getMessage());
            return;
        }

        if (originalColumns.isEmpty()) {
            System.out.println("No valid column definitions found.");
            return;
        }

        // Generate abstract CREATE TABLE statement
        String abstractSQL = generateAbstractCreateTable(originalColumns);
        System.out.println("Table statement\n" + abstractSQL);

        // Setup series generation for date/time if provided
        boolean useSeries = false;
        LocalDateTime seriesStart = null;
        Duration seriesInterval = Duration.ofSeconds(1);

        File outputFile = new File(datasetName + ".csv");
        try (BufferedWriter writer = Files.newBufferedWriter(outputFile.toPath())) {
            writer.write(datasetName + "\n");
            writer.write("--Create Table Statement\n");
            writer.write(abstractSQL + "\n");
            writer.write("--End Create Table Statement\n");
            writer.write("--Metadata\n");
            writer.write("columns=" + originalColumns.size() + "\n");
            writer.write("rows=" + rows + "\n");
            writer.write("--End Metadata\n");

            writer.write("DATA>>\n");
            Random rand = new Random();

            for (int i = 0; i < rows; i++) {
                List<String> row = generateRow(originalColumns, i, seriesStart, seriesInterval, useSeries, rand);
                writer.write(String.join(",", row) + "\n");
            }
        } catch (IOException e) {
            System.out.println("Error writing to file: " + e.getMessage());
        }
    }
Formatter for the DateTime type with nanoseconds.
performance/src/main/java/com/clickhouse/benchmark/data/DataSetGenerator.java