Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11646

SSTableWriter output discrepancy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 3.6
    • None
    • None
    • Normal

    Description

      Since CASSANDRA-10624 there is a non-trivial difference in the size of the output in CQLSSTableWriter.

      I've written the following code:

       String KS = "cql_keyspace";
              String TABLE = "table1";
      
              File tempdir = Files.createTempDir();
              File dataDir = new File(tempdir.getAbsolutePath() + File.separator + KS + File.separator + TABLE);
              assert dataDir.mkdirs();
      
              String schema = "CREATE TABLE cql_keyspace.table1 ("
                              + "  k int PRIMARY KEY,"
                              + "  v1 text,"
                              + "  v2 int"
                              + ");";// with compression = {};";
              String insert = "INSERT INTO cql_keyspace.table1 (k, v1, v2) VALUES (?, ?, ?)";
              CQLSSTableWriter writer = CQLSSTableWriter.builder()
                                                        .sorted()
                                                        .inDirectory(dataDir)
                                                        .forTable(schema)
                                                        .using(insert).build();
      
      
              for (int i = 0; i < 10000000; i++)
                  writer.addRow(i, "test1", 24);
      
              writer.close();
      

      Pre CASSANDRA-10624 the data file is ~63MB. Post it's ~69MB

      Attachments

        Activity

          People

            stefania Stefania Alborghetti
            tjake T Jake Luciani
            Stefania Alborghetti
            Alex Petrov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: