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

Improve vector value validation errors

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 5.0-alpha1, 5.0
    • Cluster/Schema
    • None

    Description

      Some of the error messages shown when trying to bind a vector column with a wrong value are a bit obscure. For example, if we try to write a value with the wrong number of dimensions:

      createTable("CREATE TABLE %s (pk int primary key, value vector<int, 2>)");
      execute("INSERT INTO %s (pk, value) VALUES (0, ?)", vector(1));
      

       The error is:

      java.lang.IndexOutOfBoundsException: Attempted to read 4, but the size is 0
      

      I understand that we cannot provide a lot of information about a non-understandable bind value, since we don't even know whether it's a vector or something entirely different. But we could try to improve it a bit and throw a MarshalException that will be translated to a InvalidRequestException, and provide generic messages similar to those used by collections:

      InvalidRequestException: Not enough bytes to read a vector<int, 2>
      

      Attachments

        Issue Links

          Activity

            People

              adelapena Andres de la Peña
              adelapena Andres de la Peña
              Andres de la Peña
              Ekaterina Dimitrova, Maxwell Guo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h