You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "448700174 (via GitHub)" <gi...@apache.org> on 2023/12/15 10:40:12 UTC

[I] Can not get all columns when join table [shardingsphere]

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

   select a.*, b.elder_name,b.insurance_no,b.gender,b.birth_day
   from medical_medicine_kit_order a, elder_info b
   where a.tenant_id = #{paramMap.tenantId} and a.elder_id = b.elder_id and a.status > 0
   
   
   Logic SQL: select a.*, b.elder_name,b.insurance_no,b.gender,b.birth_day
   		from medical_medicine_kit_order_12 a, elder_info b
   		where   a.elder_id = b.elder_id and a.status > 0 limit 10
   
   Actual SQL: ds ::: select a.*, b.elder_name,b.insurance_no,b.gender,b.birth_day
   		from medical_medicine_kit_order_12 a, elder_info b
   		where   a.elder_id = b.elder_id and a.status > 0 limit 10
   
   
    Error attempting to get column 'id' from result set.  Cause: java.sql.SQLFeatureNotSupportedException: Can not get index from column label `id`.
   ; Can not get index from column label `id`.; nested exception is java.sql.SQLFeatureNotSupportedException: Can not get index from column label `id`.
   
   I can only get elder_name、insurance_no、gender、birth_day。
   
   CREATE TABLE `medical_medicine_kit_order` (
     `id` bigint unsigned NOT NULL COMMENT 'ID',
     `elder_id` int unsigned NOT NULL COMMENT ' ',
     `tenant_id` int unsigned NOT NULL COMMENT ' ',
     `medicine_count` tinyint NOT NULL COMMENT ' ',
     `source` tinyint NOT NULL COMMENT '';)',
     `type` tinyint NOT NULL DEFAULT '1' COMMENT ' ',
    ...
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='';
   
   


-- 
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] Can not get all columns when join table [shardingsphere]

Posted by "448700174 (via GitHub)" <gi...@apache.org>.
448700174 commented on issue #29421:
URL: https://github.com/apache/shardingsphere/issues/29421#issuecomment-1858729629

   I have tried the 5.4.1, But it cannot execute correctly&nbsp; even a simple SQL.
   
   
   And My configuration on 5.4.1 is as follows:
   
   
   mode: # 不配置默认单机
   &nbsp; type: Standalone # 运行模式类型。可选配置:Standalone、Cluster
   &nbsp; repository:
   &nbsp; &nbsp; type: JDBC # 持久化仓库类型
   props:
   &nbsp; sql-show: true
   databaseName: yb_test
   dataSources:
   &nbsp; &nbsp;ds:
   &nbsp; &nbsp; &nbsp; dataSourceClassName: com.zaxxer.hikari.HikariDataSource
   &nbsp; &nbsp; &nbsp; driverClassName: com.mysql.cj.jdbc.Driver
   &nbsp; &nbsp; &nbsp; jdbcUrl: jdbc:mysql://192.168.3.227:3306/yb_test?allowMultiQueries=true&amp;serverTimezone=GMT%2B8&amp;characterEncoding=utf-8
   &nbsp; &nbsp; &nbsp; username: localdev
   &nbsp; &nbsp; &nbsp; password: M42-7Z7f
   &nbsp; &nbsp; &nbsp; minimumIdle: 2
   &nbsp; &nbsp; &nbsp; idleTimeoutMilliseconds: 600000
   &nbsp; &nbsp; &nbsp; maxPoolSize: 10
   &nbsp; &nbsp; &nbsp; minPoolSize: 1
   &nbsp; &nbsp; &nbsp; autoCommit: true
   &nbsp; &nbsp; &nbsp; poolName: MyHikariCP
   &nbsp; &nbsp; &nbsp; maxLifetimeMilliseconds: 1800000
   &nbsp; &nbsp; &nbsp; connectionTimeout: 30000
   &nbsp; &nbsp; &nbsp; connectionTestQuery: SELECT 1
   &nbsp; &nbsp;&nbsp;
   rules:
   &nbsp; - !SINGLE
   &nbsp; &nbsp; tables:
   &nbsp; &nbsp; &nbsp; - "*.*"
   &nbsp; - !SHARDING
   &nbsp; &nbsp; shardingAlgorithms:
   &nbsp; &nbsp; &nbsp; tenant_id_sharding:
   &nbsp; &nbsp; &nbsp; &nbsp; type: CLASS_BASED
   &nbsp; &nbsp; &nbsp; &nbsp; props:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strategy: standard
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; algorithmClassName: com.youban.medical.TenantIdShardingAlgorithm
   &nbsp; &nbsp; bindingTables:
   &nbsp; &nbsp; &nbsp; - medical_advice,medical_advice_main,medical_advice_group,medical_advice_item,medical_advice_dispense,medical_advice_settle,medical_advice_settle_item
   &nbsp; &nbsp; &nbsp; - medical_ward_schedule,medical_ward_record,medical_ward_abnormal
   &nbsp; &nbsp; &nbsp; - medical_medicine_kit_order,medical_medicine_kit_order_item
   &nbsp; &nbsp; &nbsp; - medical_chronic_follow,medical_chronic_data,medical_device_data,medical_device_alarm
   &nbsp; &nbsp; tables:
   &nbsp; &nbsp; &nbsp; medical_advice:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_advice_$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_advice_main:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_advice_main$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_advice_group:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_advice_group$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_advice_item:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_advice_item$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_advice_dispense:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_advice_dispense$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_advice_settle:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_advice_settle$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_advice_settle_item:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_advice_settle_item$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_ward_schedule:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_ward_schedule$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_ward_record:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_ward_record$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_ward_abnormal:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_ward_abnormal$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_medicine_kit_order:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_medicine_kit_order$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_medicine_kit_order_item:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_medicine_kit_order_item$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_chronic_follow:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_chronic_follow$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_chronic_data:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_chronic_data$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_device_data:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_device_data$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   &nbsp; &nbsp; &nbsp; medical_device_alarm:
   &nbsp; &nbsp; &nbsp; &nbsp; actualDataNodes: ds.medical_device_alarm$-&gt;{1..99}
   &nbsp; &nbsp; &nbsp; &nbsp; tableStrategy:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; standard:
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingColumn: tenant_id
   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shardingAlgorithmName: tenant_id_sharding
   
   
   
   
   
   ------------------&nbsp;原始邮件&nbsp;------------------
   发件人:                                                                                                                        "apache/shardingsphere"                                                                                    ***@***.***&gt;;
   发送时间:&nbsp;2023年12月16日(星期六) 上午8:30
   ***@***.***&gt;;
   ***@***.******@***.***&gt;;
   主题:&nbsp;Re: [apache/shardingsphere] Can not get all columns when join table (Issue #29421)
   
   
   
   
   
    
   Hi @448700174, can you try the latest version 5.4.1? I think this problem has been solved.
    
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   You are receiving this because you were mentioned.Message ID: ***@***.***&gt;


-- 
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


Re: [I] Can not get all columns when join table [shardingsphere]

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #29421:
URL: https://github.com/apache/shardingsphere/issues/29421#issuecomment-1858638079

   Hi @448700174, can you try the latest version 5.4.1? I think this problem has been solved.


-- 
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


Re: [I] Can not get all columns when join table [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #29421:
URL: https://github.com/apache/shardingsphere/issues/29421#issuecomment-3532391039

   Duplicate with #28841


-- 
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


Re: [I] Can not get all columns when join table [shardingsphere]

Posted by "448700174 (via GitHub)" <gi...@apache.org>.
448700174 commented on issue #29421:
URL: https://github.com/apache/shardingsphere/issues/29421#issuecomment-1869448539

   Can you give me  some suggestion on 5.4.1? I guess the problem is that I have not config the single tables with exact table name? But I don't want to do that because I have hundreds tables.


-- 
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


Re: [I] Can not get all columns when join table [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #29421:
URL: https://github.com/apache/shardingsphere/issues/29421#issuecomment-1910908278

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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


Re: [I] Can not get all columns when join table [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #29421: Can not get all columns when join table
URL: https://github.com/apache/shardingsphere/issues/29421


-- 
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