Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4541

ERROR 1928 (HY000): Internal error: 'Some of SQL fields were not mapped to Cassandra's fields'

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Linux x64, Apache Cassandra 1.2.4

      Description

      When creating a Table in MariaDB pointing to Cassandra Engine, I get:

      ERROR 1928 (HY000): Internal error: 'Some of SQL fields were not mapped to Cassandra's fields'

      Fields appear to exist in both the command + Cassandra. I am unsure what this error means.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Please provide both Cassandra column family structure and MariaDB CREATE TABLE.
            Thanks.

            Show
            elenst Elena Stepanova added a comment - Please provide both Cassandra column family structure and MariaDB CREATE TABLE. Thanks.
            Hide
            rwagner Robert Wagner added a comment - - edited

            Cassandra-CLI
            CREATE COLUMN FAMILY te_ACLEntry WITH comparator=UTF8Type AND column_metadata = [

            {column_name:te_ACLEntryId, validation_class:LongType}

            {column_name:te_ACLID, validation_class:LongType, index_type: KEYS}

            {column_name:te_ACLRight, validation_class:LongType}

            {column_name:te_CreationTime, validation_class:LongType}

            {column_name:te_EndTime, validation_class:LongType}

            {column_name:te_MaxUsage, validation_class:LongType}

            {column_name:te_PrincipalID, validation_class:LongType, index_type: KEYS}

            {column_name:te_StartTime, validation_class:LongType}

            {column_name:te_SystemID, validation_class:LongType, index_type: KEYS}

            {column_name:te_UserRight, validation_class:LongType}

            {column_name:te_signature, validation_class:UTF8Type}

            ];

            MariaDB:
            CREATE TABLE te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='eruces_keys' column_family='te_ACLEntry';

            Note - tried several different ways to create a link.

            [default@eruces_keys] show schema;

            WARNING: CQL3 tables are intentionally omitted from 'show schema' output.
            See https://issues.apache.org/jira/browse/CASSANDRA-4377 for details.

            create keyspace eruces_keys
            with placement_strategy = 'SimpleStrategy'
            and strategy_options =

            {replication_factor : 3}

            and durable_writes = true;

            use eruces_keys;

            create column family te_ACLEntry
            with column_type = 'Standard'
            and comparator = 'UTF8Type'
            and default_validation_class = 'BytesType'
            and key_validation_class = 'BytesType'
            and read_repair_chance = 0.1
            and dclocal_read_repair_chance = 0.0
            and populate_io_cache_on_flush = false
            and gc_grace = 864000
            and min_compaction_threshold = 4
            and max_compaction_threshold = 32
            and replicate_on_write = true
            and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
            and caching = 'KEYS_ONLY'
            and column_metadata = [

            {column_name : 'te_EndTime', validation_class : LongType}

            ,

            {column_name : 'te_PrincipalID', validation_class : LongType, index_name : 'te_ACLEntry_te_PrincipalID_idx', index_type : 0}

            ,

            {column_name : 'te_CreationTime', validation_class : LongType}

            ,

            {column_name : 'te_ACLID', validation_class : LongType, index_name : 'te_ACLEntry_te_ACLID_idx', index_type : 0}

            ,

            {column_name : 'te_ACLRight', validation_class : LongType}

            ,

            {column_name : 'te_StartTime', validation_class : LongType}

            ,

            {column_name : 'te_ACLEntryId', validation_class : LongType}

            ,

            {column_name : 'te_UserRight', validation_class : LongType}

            ,

            {column_name : 'te_MaxUsage', validation_class : LongType}

            ,

            {column_name : 'te_SystemID', validation_class : LongType, index_name : 'te_ACLEntry_te_SystemID_idx', index_type : 0}

            ,

            {column_name : 'te_signature', validation_class : UTF8Type}

            ]
            and compression_options =

            {'sstable_compression' : 'org.apache.cassandra.io.compress.SnappyCompressor'}

            ;

            Show
            rwagner Robert Wagner added a comment - - edited Cassandra-CLI CREATE COLUMN FAMILY te_ACLEntry WITH comparator=UTF8Type AND column_metadata = [ {column_name:te_ACLEntryId, validation_class:LongType} {column_name:te_ACLID, validation_class:LongType, index_type: KEYS} {column_name:te_ACLRight, validation_class:LongType} {column_name:te_CreationTime, validation_class:LongType} {column_name:te_EndTime, validation_class:LongType} {column_name:te_MaxUsage, validation_class:LongType} {column_name:te_PrincipalID, validation_class:LongType, index_type: KEYS} {column_name:te_StartTime, validation_class:LongType} {column_name:te_SystemID, validation_class:LongType, index_type: KEYS} {column_name:te_UserRight, validation_class:LongType} {column_name:te_signature, validation_class:UTF8Type} ]; MariaDB: CREATE TABLE te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='eruces_keys' column_family='te_ACLEntry'; Note - tried several different ways to create a link. [default@eruces_keys] show schema; WARNING: CQL3 tables are intentionally omitted from 'show schema' output. See https://issues.apache.org/jira/browse/CASSANDRA-4377 for details. create keyspace eruces_keys with placement_strategy = 'SimpleStrategy' and strategy_options = {replication_factor : 3} and durable_writes = true; use eruces_keys; create column family te_ACLEntry with column_type = 'Standard' and comparator = 'UTF8Type' and default_validation_class = 'BytesType' and key_validation_class = 'BytesType' and read_repair_chance = 0.1 and dclocal_read_repair_chance = 0.0 and populate_io_cache_on_flush = false and gc_grace = 864000 and min_compaction_threshold = 4 and max_compaction_threshold = 32 and replicate_on_write = true and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' and caching = 'KEYS_ONLY' and column_metadata = [ {column_name : 'te_EndTime', validation_class : LongType} , {column_name : 'te_PrincipalID', validation_class : LongType, index_name : 'te_ACLEntry_te_PrincipalID_idx', index_type : 0} , {column_name : 'te_CreationTime', validation_class : LongType} , {column_name : 'te_ACLID', validation_class : LongType, index_name : 'te_ACLEntry_te_ACLID_idx', index_type : 0} , {column_name : 'te_ACLRight', validation_class : LongType} , {column_name : 'te_StartTime', validation_class : LongType} , {column_name : 'te_ACLEntryId', validation_class : LongType} , {column_name : 'te_UserRight', validation_class : LongType} , {column_name : 'te_MaxUsage', validation_class : LongType} , {column_name : 'te_SystemID', validation_class : LongType, index_name : 'te_ACLEntry_te_SystemID_idx', index_type : 0} , {column_name : 'te_signature', validation_class : UTF8Type} ] and compression_options = {'sstable_compression' : 'org.apache.cassandra.io.compress.SnappyCompressor'} ;
            Hide
            rwagner Robert Wagner added a comment -

            I think I zapped part of the structure when I tried to solve this error. by running this command:
            update column family te_ACLEntry with column_metadata = [

            {column_name:te_ACLEntryId, validation_class:LongType, index_type: KEYS}

            ];

            If I recreate the column family, with multiple KEYS, I get an error about Primary Key must be neame rowkey. I cannot find information on creating an Alias for a column_name.

            CREATE TABLE te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='eruces_keys' column_family='te_ACLEntry';
            ERROR 1928 (HY000): Internal error: 'target column family has no key_alias defined, PRIMARY KEY column must be named 'rowkey''

            Show
            rwagner Robert Wagner added a comment - I think I zapped part of the structure when I tried to solve this error. by running this command: update column family te_ACLEntry with column_metadata = [ {column_name:te_ACLEntryId, validation_class:LongType, index_type: KEYS} ]; If I recreate the column family, with multiple KEYS, I get an error about Primary Key must be neame rowkey. I cannot find information on creating an Alias for a column_name. CREATE TABLE te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='eruces_keys' column_family='te_ACLEntry'; ERROR 1928 (HY000): Internal error: 'target column family has no key_alias defined, PRIMARY KEY column must be named 'rowkey''
            Hide
            rwagner Robert Wagner added a comment -

            Figured out the problem.... Must create tables with CQL instead of cassandra-CLI

            cqlsh:eruces_keys> create columnfamily te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar);

            MariaDB [cass_keys]> CREATE TABLE te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='eruces_keys' column_family='te_ACLEntry';
            Query OK, 0 rows affected (0.02 sec)

            Works fine now...will move onto Primary Key + Secondary Keys and test...

            Show
            rwagner Robert Wagner added a comment - Figured out the problem.... Must create tables with CQL instead of cassandra-CLI cqlsh:eruces_keys> create columnfamily te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar); MariaDB [cass_keys] > CREATE TABLE te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='eruces_keys' column_family='te_ACLEntry'; Query OK, 0 rows affected (0.02 sec) Works fine now...will move onto Primary Key + Secondary Keys and test...
            Hide
            rwagner Robert Wagner added a comment -

            Multiple_keys has a problem....See https://mariadb.atlassian.net/browse/MDEV-4543
            This one can be closed.

            Show
            rwagner Robert Wagner added a comment - Multiple_keys has a problem....See https://mariadb.atlassian.net/browse/MDEV-4543 This one can be closed.
            Hide
            psergey Sergei Petrunia added a comment -

            I have tried with Cassandra 1.1.4:

                1. Create column family exactly as was specified:

            CREATE COLUMN FAMILY te_ACLEntry WITH comparator=UTF8Type AND column_metadata = [

            {column_name:te_ACLEntryId, validation_class:LongType}

            {column_name:te_ACLID, validation_class:LongType, index_type: KEYS}

            {column_name:te_ACLRight, validation_class:LongType}

            {column_name:te_CreationTime, validation_class:LongType}

            {column_name:te_EndTime, validation_class:LongType}

            {column_name:te_MaxUsage, validation_class:LongType}

            {column_name:te_PrincipalID, validation_class:LongType, index_type: KEYS}

            {column_name:te_StartTime, validation_class:LongType}

            {column_name:te_SystemID, validation_class:LongType, index_type: KEYS}

            {column_name:te_UserRight, validation_class:LongType}

            {column_name:te_signature, validation_class:UTF8Type}

            ];
            d8ae07a4-2d6a-30ea-992e-dda0389a9669
            Waiting for schema agreement...
            ... schemas agree across the cluster

                1. Try the original CREATE TABLE :
                  MariaDB [test]> CREATE TABLE te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='mariadbtest2' column_family='te_ACLEntry';
                  ERROR 1928 (HY000): Internal error: 'target column family has no key_alias defined, PRIMARY KEY column must be named 'rowkey''
              1. Change the primary key column to be named 'rowkey':
                MariaDB [test]> CREATE TABLE te_ACLEntry (rowkey bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='mariadbtest2' column_family='te_ACLEntry';
                ERROR 1928 (HY000): Internal error: 'Failed to map PRIMARY KEY to datatype org.apache.cassandra.db.marshal.BytesType'
                1. Change the datatype of rowkey to match Cassandra's "BytesType":
                  MariaDB [test]> CREATE TABLE te_ACLEntry (rowkey binary(32) primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='mariadbtest2' column_family='te_ACLEntry';
                  Query OK, 0 rows affected (0.04 sec)

            It worked.

            Show
            psergey Sergei Petrunia added a comment - I have tried with Cassandra 1.1.4: Create column family exactly as was specified: CREATE COLUMN FAMILY te_ACLEntry WITH comparator=UTF8Type AND column_metadata = [ {column_name:te_ACLEntryId, validation_class:LongType} {column_name:te_ACLID, validation_class:LongType, index_type: KEYS} {column_name:te_ACLRight, validation_class:LongType} {column_name:te_CreationTime, validation_class:LongType} {column_name:te_EndTime, validation_class:LongType} {column_name:te_MaxUsage, validation_class:LongType} {column_name:te_PrincipalID, validation_class:LongType, index_type: KEYS} {column_name:te_StartTime, validation_class:LongType} {column_name:te_SystemID, validation_class:LongType, index_type: KEYS} {column_name:te_UserRight, validation_class:LongType} {column_name:te_signature, validation_class:UTF8Type} ]; d8ae07a4-2d6a-30ea-992e-dda0389a9669 Waiting for schema agreement... ... schemas agree across the cluster Try the original CREATE TABLE : MariaDB [test] > CREATE TABLE te_ACLEntry (te_ACLEntryId bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='mariadbtest2' column_family='te_ACLEntry'; ERROR 1928 (HY000): Internal error: 'target column family has no key_alias defined, PRIMARY KEY column must be named 'rowkey'' Change the primary key column to be named 'rowkey': MariaDB [test] > CREATE TABLE te_ACLEntry (rowkey bigint primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='mariadbtest2' column_family='te_ACLEntry'; ERROR 1928 (HY000): Internal error: 'Failed to map PRIMARY KEY to datatype org.apache.cassandra.db.marshal.BytesType' Change the datatype of rowkey to match Cassandra's "BytesType": MariaDB [test] > CREATE TABLE te_ACLEntry (rowkey binary(32) primary key, te_ACLID bigint, te_ACLRight bigint, te_CreationTime bigint, te_EndTime bigint, te_MaxUsage bigint, te_PrincipalID bigint, te_StartTime bigint, te_SystemID bigint, te_UserRight bigint, te_signature varchar(100) ) engine=cassandra keyspace='mariadbtest2' column_family='te_ACLEntry'; Query OK, 0 rows affected (0.04 sec) It worked.
            Hide
            psergey Sergei Petrunia added a comment -

            The commands posted in the previous work with Cassandra 1.2.4, too.

            Show
            psergey Sergei Petrunia added a comment - The commands posted in the previous work with Cassandra 1.2.4, too.
            Hide
            psergey Sergei Petrunia added a comment -

            Closing this issue, as requested. MDEV-4543 will be processed separately.

            Show
            psergey Sergei Petrunia added a comment - Closing this issue, as requested. MDEV-4543 will be processed separately.

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                rwagner Robert Wagner
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: