You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zihaoAK47 (via GitHub)" <gi...@apache.org> on 2024/05/16 10:20:46 UTC

[I] The federated query cannot get data of binary type [shardingsphere]

zihaoAK47 opened a new issue, #31247:
URL: https://github.com/apache/shardingsphere/issues/31247

   Hi Community, federated query cannot query binary type data, none of the following types can be queried.
   + BIT
   + BINARY
   + VARBINARY
   + BLOB
   + LONGBLOB
   + MEDIUMBLOB
   
   ### Which version of ShardingSphere did you use?
   master
   mysql: 8.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC and ShardingSphere-Proxy
   
   ### Expected behavior
   ![2024-05-16 17 23 29](https://github.com/apache/shardingsphere/assets/106047330/973d0b8b-1059-4585-b5ff-56bfae3f8f5b)
   
   ### Actual behavior
   ![截屏2024-05-16 17 25 19](https://github.com/apache/shardingsphere/assets/106047330/b34d7949-7c2a-48e9-8255-48ec2575fb4c)
   
   ```
   ERROR 30000 (HY000): Unknown exception.
   More details: class [B cannot be cast to class [Ljava.lang.Object; ([B and [Ljava.lang.Object; are in module java.base of loader 'bootstrap')
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   ```
   sqlFederation:
     sqlFederationEnabled: true
     allQueryUseSQLFederation: true
     executionPlanCache:
       initialCapacity: 2000
       maximumSize: 65535
   ```
   
   ```
   create table t_product_extend
   (
       extend_id              int                                           not null
           primary key,
       product_id             int                                           not null,
       type_int               int                                           not null,
       type_smallint          smallint                                      not null,
       type_decimal           decimal                                       not null,
       type_float             float                                         not null,
       type_double            double                                        not null,
       type_bit               bit(64)                                       not null,
       type_tinyint           tinyint                                       not null,
       type_mediumint         mediumint                                     not null,
       type_bigint            bigint                                        not null,
       type_date              date                                          not null,
       type_time              time                                          not null,
       type_datetime          datetime                                      not null,
       type_timestamp         timestamp                                     not null,
       type_year              year                                          not null,
       type_char              char                                          not null,
       type_text              text                                          not null,
       type_varchar           varchar(50)                                   not null,
       type_longtext          longtext                                      not null,
       type_longblob          longblob                                      not null,
       type_mediumtext        mediumtext                                    not null,
       type_mediumblob        mediumblob                                    not null,
       type_binary            binary(255)                                   not null,
       type_varbinary         varbinary(1024)                               not null,
       type_blob              blob                                          not null,
       type_enum              enum ('spring', 'summer', 'autumn', 'winter') not null,
       type_set               set ('spring', 'summer', 'autumn', 'winter')  not null,
       type_json              json                                          not null,
       type_unsigned_int      int unsigned                                  not null,
       type_unsigned_bigint   bigint unsigned                               not null,
       type_unsigned_tinyint  tinyint unsigned                              not null,
       type_unsigned_smallint smallint unsigned                             not null,
       type_unsigned_float    float unsigned                                not null,
       type_unsigned_double   double unsigned                               not null,
       type_unsigned_decimal  decimal unsigned                              not null
   );
   ```
   
   ```
   INSERT INTO t_product_extend (extend_id, product_id, type_int, type_smallint, type_decimal, type_float, type_double,
                                 type_bit, type_tinyint, type_mediumint, type_bigint, type_date, type_time, type_datetime,
                                 type_timestamp, type_year, type_char, type_text, type_varchar, type_longtext,
                                 type_longblob, type_mediumtext, type_mediumblob, type_binary, type_varbinary, type_blob,
                                 type_enum, type_set, type_json, type_unsigned_int, type_unsigned_bigint,
                                 type_unsigned_tinyint, type_unsigned_smallint, type_unsigned_float, type_unsigned_double,
                                 type_unsigned_decimal)
   VALUES (1, 1001, 10, 5, 10.5, 10.5, 10.5, b'1010101010', 1, 5000, 10000000000, '2024-05-16', '12:00:00',
           '2024-05-16 12:00:00', '2024-05-16 12:00:00', 2024, 'C', 'This is a text', 'Product1', 'This is a long text',
           'Long blob data', 'This is a medium text', 'Medium blob data', b'11001100', X'010101010101', 'Blob data',
           'spring', 'spring,summer', '{
       "key1": "value1",
       "key2": "value2"
     }', 20, 20000000000, 200, 100, 20.5, 20.5, 20.5);
   ```
   
   ```
   select type_bit from t_product_extend;
   select type_binary from t_product_extend;
   select type_varbinary from t_product_extend;
   select type_blob from t_product_extend;
   select type_mediumblob from t_product_extend;
   select type_longblob from t_product_extend;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] The federated query cannot get data of binary type [shardingsphere]

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu closed issue #31247: The federated query cannot get data of binary type
URL: https://github.com/apache/shardingsphere/issues/31247


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org