Cassandra
  1. Cassandra
  2. CASSANDRA-4779

Boolean type of composite column of compound primary key converted into UTF8Type

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not A Problem
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Steps to reproduce:
      1) connect to cqlsh --cql3
      2) create keyspace testcomp;
      3) CREATE TABLE altercations (
      instigator text,
      started_at timestamp,
      ships_destroyed int,
      energy_used float,
      alliance_involvement boolean,
      PRIMARY KEY (instigator,started_at,ships_destroyed)
      4) INSERT INTO altercations (instigator, started_at, ships_destroyed,
      energy_used, alliance_involvement)
      VALUES ('Jayne Cobb', '2012-07-24', 2, 4.6, 'false');
      5) select * from altercations; gives output:
      instigator | started_at | ships_destroyed | alliance_involvement | energy_used
      ----------------------------------------------------------------------------------
      Jayne Cobb | 2012-07-23 00:00:00+0000 | 2 | False | 4.6

      But when try to connect via cassandra-cli and execute:

      6)list altercations; (output gives an error as below):
      Using default limit of 100
      Using default column limit of 100
      -------------------
      RowKey: Jayne Cobb
      => (column=2012-07-23 00:00:00+0530:2:alliance_involvement, value=, timestamp=1349772570037000)
      invalid UTF8 bytes 40933333

      gives me

      {invalid UTF8 bytes 40933333}

      Keyspace description:
      Keyspace: testcomp:
      Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
      Durable Writes: true
      Options: [datacenter1:1]
      Column Families:
      ColumnFamily: altercations
      Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
      Default column value validator: org.apache.cassandra.db.marshal.UTF8Type
      Columns sorted by: org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.DateType,org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)
      GC grace seconds: 864000
      Compaction min/max thresholds: 4/32
      Read repair chance: 0.1
      DC Local Read repair chance: 0.0
      Replicate on write: true
      Caching: KEYS_ONLY
      Bloom Filter FP chance: default
      Built indexes: []
      Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
      Compression Options:
      sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor

      Issue:
      org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.DateType,org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)

      Although alliance_involvement is of "boolean" data type! which is causing this issue.

      Looks like an issue with CompositeType creation, somehow boolean is also treated as UTF8Type.

        Activity

        Gavin made changes -
        Workflow patch-available, re-open possible [ 12753262 ] reopen-resolved, no closed status, patch-avail, testing [ 12758667 ]
        Gavin made changes -
        Workflow no-reopen-closed, patch-avail [ 12728873 ] patch-available, re-open possible [ 12753262 ]
        Jonathan Ellis made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not A Problem [ 8 ]
        Vivek Mishra made changes -
        Field Original Value New Value
        Description Steps to reproduce:
        1) connect to cqlsh --cql3
        2) create keyspace testcomp;
        3) CREATE TABLE altercations (
               instigator text,
               started_at timestamp,
               ships_destroyed int,
               energy_used float,
               alliance_involvement boolean,
               PRIMARY KEY (instigator,started_at,ships_destroyed)
        4) INSERT INTO altercations (instigator, started_at, ships_destroyed,
                                     energy_used, alliance_involvement)
                             VALUES ('Jayne Cobb', '2012-07-24', 2, 4.6, 'false');
        5) select * from altercations; gives output:
         instigator | started_at | ships_destroyed | alliance_involvement | energy_used
        ------------+--------------------------+-----------------+----------------------+-------------
         Jayne Cobb | 2012-07-23 00:00:00+0000 | 2 | False | 4.6

        But when try to connect via cassandra-cli and execute:

        6)list altercations; (output gives an error as below):
        Using default limit of 100
        Using default column limit of 100
        -------------------
        RowKey: Jayne Cobb
        => (column=2012-07-23 00:00:00+0530:2:alliance_involvement, value=, timestamp=1349772570037000)
        invalid UTF8 bytes 40933333

        gives me {invalid UTF8 bytes 40933333}

        Keyspace description:
        Keyspace: testcomp:
          Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
          Durable Writes: true
            Options: [datacenter1:1]
          Column Families:
            ColumnFamily: altercations
              Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
              Default column value validator: org.apache.cassandra.db.marshal.UTF8Type
              Columns sorted by: org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.DateType,org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)
              GC grace seconds: 864000
              Compaction min/max thresholds: 4/32
              Read repair chance: 0.1
              DC Local Read repair chance: 0.0
              Replicate on write: true
              Caching: KEYS_ONLY
              Bloom Filter FP chance: default
              Built indexes: []
              Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
              Compression Options:
                sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor


        Issue:
        org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.DateType,org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)

        Although alliance_involvement is of "boolean" data type! which is causing this issue.

        Looks like an issue with CompositeType creation, somehow boolean is also treated as UTF8Type.


        Steps to reproduce:
        1) connect to cqlsh --cql3
        2) create keyspace testcomp;
        3) CREATE TABLE altercations (
               instigator text,
               started_at timestamp,
               ships_destroyed int,
               energy_used float,
               alliance_involvement boolean,
               PRIMARY KEY (instigator,started_at,ships_destroyed)
        4) INSERT INTO altercations (instigator, started_at, ships_destroyed,
                                     energy_used, alliance_involvement)
                             VALUES ('Jayne Cobb', '2012-07-24', 2, 4.6, 'false');
        5) select * from altercations; gives output:
         instigator | started_at | ships_destroyed | alliance_involvement | energy_used
        ------------+--------------------------+-----------------+----------------------+-------------
         Jayne Cobb | 2012-07-23 00:00:00+0000 | 2 | False | 4.6

        But when try to connect via cassandra-cli and execute:
         
        6)list altercations; (output gives an error as below):
        Using default limit of 100
        Using default column limit of 100
        -------------------
        RowKey: Jayne Cobb
        => (column=2012-07-23 00:00:00+0530:2:alliance_involvement, value=, timestamp=1349772570037000)
        invalid UTF8 bytes 40933333

        gives me {invalid UTF8 bytes 40933333}

        Keyspace description:
        Keyspace: testcomp:
          Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
          Durable Writes: true
            Options: [datacenter1:1]
          Column Families:
            ColumnFamily: altercations
              Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
              Default column value validator: org.apache.cassandra.db.marshal.UTF8Type
              Columns sorted by: org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.DateType,org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)
              GC grace seconds: 864000
              Compaction min/max thresholds: 4/32
              Read repair chance: 0.1
              DC Local Read repair chance: 0.0
              Replicate on write: true
              Caching: KEYS_ONLY
              Bloom Filter FP chance: default
              Built indexes: []
              Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
              Compression Options:
                sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor


        Issue:
        org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.DateType,org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type)

        Although alliance_involvement is of "boolean" data type! which is causing this issue.

        Looks like an issue with CompositeType creation, somehow boolean is also treated as UTF8Type.


        Vivek Mishra created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Vivek Mishra
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development