[GitHub] [incubator-shardingsphere] terrymanu commented on issue #3886: Can we consider sharing the pool of sharded data source connections?

2020-01-07 Thread GitBox
terrymanu commented on issue #3886: Can we consider sharing the pool of sharded 
data source connections?
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3886#issuecomment-571482780
 
 
   Share pool config may let user confuse, for each connection pool should has 
independent config.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] SteNicholas commented on issue #3884: Insert SQL with null value of shardingColumns may be routed to multiple dataNodes.

2020-01-07 Thread GitBox
SteNicholas commented on issue #3884: Insert SQL with null value of 
shardingColumns may be routed to multiple dataNodes.
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3884#issuecomment-571501043
 
 
   @KomachiSion Assign to me please.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] terrymanu commented on issue #3881: Is there any way optimizing "limit" in the following situation?

2020-01-07 Thread GitBox
terrymanu commented on issue #3881: Is there any way optimizing "limit" in the 
following situation?  
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3881#issuecomment-571502531
 
 
   the `order by` in SQL is up to user, how about is the `order by item` is not 
sharding key?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] terrymanu edited a comment on issue #3881: Is there any way optimizing "limit" in the following situation?

2020-01-07 Thread GitBox
terrymanu edited a comment on issue #3881: Is there any way optimizing "limit" 
in the following situation?  
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3881#issuecomment-571502531
 
 
   the `order by` in SQL is up to user, how about is the `order by item` is not 
sharding key?
   We won't talk about any special situation, ShardingSphere is just for 
regular SQL and provide a regular solution.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] terrymanu edited a comment on issue #3881: Is there any way optimizing "limit" in the following situation?

2020-01-07 Thread GitBox
terrymanu edited a comment on issue #3881: Is there any way optimizing "limit" 
in the following situation?  
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3881#issuecomment-571502531
 
 
   The `order by` in SQL is up to user, how about is the `order by item` is not 
sharding key?
   
   The precondition of discussion is talking about the regular solution. The 
solution about `log data` is special situation which should not consider about 
a regular database middleware, it is not serve for `log data` only.
   
   We won't talk about any special situation, ShardingSphere is just for 
regular SQL and provide a regular solution.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] alexkuku commented on issue #3881: Is there any way optimizing "limit" in the following situation?

2020-01-07 Thread GitBox
alexkuku commented on issue #3881: Is there any way optimizing "limit" in the 
following situation?  
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3881#issuecomment-571514438
 
 
   OK.Thank you!This is indeed a special situation.
   It seems that I can only get that effect by optimizing my business code.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-shardingsphere-benchmark] branch master updated: update

2020-01-07 Thread zhaoyanan
This is an automated email from the ASF dual-hosted git repository.

zhaoyanan pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-shardingsphere-benchmark.git


The following commit(s) were added to refs/heads/master by this push:
 new 30af985  update
30af985 is described below

commit 30af985c251d891d161dae2de574672b2f00702b
Author: nancyzrh 
AuthorDate: Tue Jan 7 17:57:44 2020 +0800

update
---
 report/jtl_json/full_route_test.json| 2 +-
 report/jtl_json/master_slave_encrypt_sharding_test.json | 2 +-
 report/jtl_json/single_route_test.json  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/report/jtl_json/full_route_test.json 
b/report/jtl_json/full_route_test.json
index b5de4f2..b4cab02 100644
--- a/report/jtl_json/full_route_test.json
+++ b/report/jtl_json/full_route_test.json
@@ -1 +1 @@
-{"SELECT": [{"data": [{"99.9th": "9", "Err": "0.0%", "95th": "2", "50th": "1", 
"Max": "10", "Min": "0", "Throughout": "23036.87", "Samples": 4999, "Date": 
"2019.12.19 02:35:57 ", "Avg": "0"}, {"99.9th": "9", "Err": "0.0%", "95th": 
"2", "50th": "1", "Max": "9", "Min": "0", "Throughout": "22619.91", "Samples": 
4999, "Date": "2019.12.20 13:34:47 ", "Avg": "0"}, {"99.9th": "9", "Err": 
"0.0%", "95th": "2", "50th": "1", "Max": "9", "Min": "0", "Throughout": 
"22931.19", "Samples": 4999, "Date": [...]
\ No newline at end of file
+{"SELECT": [{"data": [{"99.9th": "9", "Err": "0.0%", "95th": "2", "50th": "1", 
"Max": "10", "Min": "0", "Throughout": "23036.87", "Samples": 4999, "Date": 
"2019.12.19 02:35:57 ", "Avg": "0"}, {"99.9th": "9", "Err": "0.0%", "95th": 
"2", "50th": "1", "Max": "9", "Min": "0", "Throughout": "22619.91", "Samples": 
4999, "Date": "2019.12.20 13:34:47 ", "Avg": "0"}, {"99.9th": "9", "Err": 
"0.0%", "95th": "2", "50th": "1", "Max": "9", "Min": "0", "Throughout": 
"22931.19", "Samples": 4999, "Date": [...]
\ No newline at end of file
diff --git a/report/jtl_json/master_slave_encrypt_sharding_test.json 
b/report/jtl_json/master_slave_encrypt_sharding_test.json
index cdccc03..70dd09d 100644
--- a/report/jtl_json/master_slave_encrypt_sharding_test.json
+++ b/report/jtl_json/master_slave_encrypt_sharding_test.json
@@ -1 +1 @@
-{"SELECT": [{"data": [{"99.9th": "16", "Err": "0.0%", "95th": "3", "50th": 
"2", "Max": "66", "Min": "1", "Throughout": "9381.73", "Samples": 99, 
"Date": "2019.12.19 02:40:33 ", "Avg": "2"}, {"99.9th": "16", "Err": "0.0%", 
"95th": "3", "50th": "2", "Max": "62", "Min": "1", "Throughout": "9038.48", 
"Samples": 99, "Date": "2019.12.20 13:39:23 ", "Avg": "2"}, {"99.9th": 
"16", "Err": "0.0%", "95th": "3", "50th": "2", "Max": "63", "Min": "1", 
"Throughout": "9071.44", "Samples": 99, [...]
\ No newline at end of file
+{"SELECT": [{"data": [{"99.9th": "16", "Err": "0.0%", "95th": "3", "50th": 
"2", "Max": "66", "Min": "1", "Throughout": "9381.73", "Samples": 99, 
"Date": "2019.12.19 02:40:33 ", "Avg": "2"}, {"99.9th": "16", "Err": "0.0%", 
"95th": "3", "50th": "2", "Max": "62", "Min": "1", "Throughout": "9038.48", 
"Samples": 99, "Date": "2019.12.20 13:39:23 ", "Avg": "2"}, {"99.9th": 
"16", "Err": "0.0%", "95th": "3", "50th": "2", "Max": "63", "Min": "1", 
"Throughout": "9071.44", "Samples": 99, [...]
\ No newline at end of file
diff --git a/report/jtl_json/single_route_test.json 
b/report/jtl_json/single_route_test.json
index 8b49cf5..90a0015 100644
--- a/report/jtl_json/single_route_test.json
+++ b/report/jtl_json/single_route_test.json
@@ -1 +1 @@
-{"SELECT": [{"data": [], "type": "Sharding-Proxy_3.1"}, {"data": [{"99.9th": 
"2", "Err": "0.0%", "95th": "2", "50th": "1", "Max": "18", "Min": "0", 
"Throughout": "19704.03", "Samples": 99, "Date": "2019.12.19 02:37:46 ", 
"Avg": "0"}, {"99.9th": "2", "Err": "0.0%", "95th": "2", "50th": "1", "Max": 
"17", "Min": "0", "Throughout": "19820.41", "Samples": 99, "Date": 
"2019.12.20 13:36:37 ", "Avg": "0"}, {"99.9th": "2", "Err": "0.0%", "95th": 
"2", "50th": "1", "Max": "17", "Min": "0",  [...]
\ No newline at end of file
+{"SELECT": [{"data": [], "type": "Sharding-Proxy_3.1"}, {"data": [{"99.9th": 
"2", "Err": "0.0%", "95th": "2", "50th": "1", "Max": "18", "Min": "0", 
"Throughout": "19704.03", "Samples": 99, "Date": "2019.12.19 02:37:46 ", 
"Avg": "0"}, {"99.9th": "2", "Err": "0.0%", "95th": "2", "50th": "1", "Max": 
"17", "Min": "0", "Throughout": "19820.41", "Samples": 99, "Date": 
"2019.12.20 13:36:37 ", "Avg": "0"}, {"99.9th": "2", "Err": "0.0%", "95th": 
"2", "50th": "1", "Max": "17", "Min": "0",  [...]
\ No newline at end of file



[GitHub] [incubator-shardingsphere] terrymanu opened a new pull request #3890: Use SQLRewriteEntry on encrypt and shadow

2020-01-07 Thread GitBox
terrymanu opened a new pull request #3890: Use SQLRewriteEntry on encrypt and 
shadow
URL: https://github.com/apache/incubator-shardingsphere/pull/3890
 
 
   For #3691.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] tristaZero merged pull request #3890: Use SQLRewriteEntry on encrypt and shadow

2020-01-07 Thread GitBox
tristaZero merged pull request #3890: Use SQLRewriteEntry on encrypt and shadow
URL: https://github.com/apache/incubator-shardingsphere/pull/3890
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] cherrylzhao opened a new pull request #3891: fix NullPointException for resultSetMetaData.getTableName of Proxy

2020-01-07 Thread GitBox
cherrylzhao opened a new pull request #3891: fix NullPointException for 
resultSetMetaData.getTableName of Proxy
URL: https://github.com/apache/incubator-shardingsphere/pull/3891
 
 
   tableName from ResultSetMetaData maybe null depends on vendor's 
implementation


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] Sunnycheey commented on issue #3865: Create tables automatically by ddl

2020-01-07 Thread GitBox
Sunnycheey commented on issue #3865: Create tables automatically by ddl
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3865#issuecomment-571547431
 
 
   Thanks for your all, and thanks for the suggesstion of @taojintianxia , I am 
going to try sharding-proxy. 
   
   Feel free to close the issue.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] wgy8283335 commented on a change in pull request #3887: Feature 3185 add nacos center

2020-01-07 Thread GitBox
wgy8283335 commented on a change in pull request #3887: Feature 3185 add nacos 
center
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3887#discussion_r363706760
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-nacos/src/main/java/org/apache/shardingsphere/orchestration/center/instance/NacosInstance.java
 ##
 @@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.orchestration.center.instance;
+
+import com.alibaba.nacos.api.NacosFactory;
+import com.alibaba.nacos.api.config.ConfigService;
+import com.alibaba.nacos.api.config.listener.Listener;
+import com.alibaba.nacos.api.exception.NacosException;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Executor;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.orchestration.center.api.ConfigCenter;
+import 
org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
+import 
org.apache.shardingsphere.orchestration.center.listener.DataChangedEvent;
+import 
org.apache.shardingsphere.orchestration.center.listener.DataChangedEventListener;
+
+/**
+ * The nacos instance for ConfigCenter.
+ *
+ * @author huangjian
+ * @author sunbufu
+ */
+@Slf4j
+public class NacosInstance implements ConfigCenter {
+
+private final String defaultGroup = "SHARDING_SPHERE_DEFAULT_GROUP";
+
+private ConfigService configService;
+
+@Getter
+@Setter
+private Properties properties = new Properties();
+
+/**
+ * Initialize nacos instance.
+ *
+ * @param config config center configuration
+ */
+@Override
+public void init(final InstanceConfiguration config) {
+try {
+Properties properties = new Properties();
+properties.put("serverAddr", config.getServerLists());
+properties.put("namespace", null == config.getNamespace() ? "" : 
config.getNamespace());
+configService = NacosFactory.createConfigService(properties);
+} catch (final NacosException ex) {
+log.debug("exception for: {}", ex.toString());
+}
+}
+
+/**
+ * Get data from nacos instance.
+ *
+ * @param key key of data
+ * @return value of data
+ */
+@Override
+public String get(final String key) {
+return getDirectly(key);
+}
+
+private String getDirectly(final String key) {
+try {
+String dataId = key.replace("/", ".");
+String group = properties.getProperty("group", defaultGroup);
+long timeoutMs = Long.parseLong(properties.getProperty("timeout", 
"3000"));
+return configService.getConfig(dataId, group, timeoutMs);
+} catch (final NacosException ex) {
+log.debug("exception for: {}", ex.toString());
+return null;
+}
+}
+
+/**
+ * Get node's sub-nodes list.
+ *
+ * @param key key of data
+ * @return sub-nodes name list
+ */
+@Override
+public List getChildrenKeys(final String key) {
 
 Review comment:
   If return "null", whether there will be problems.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] wgy8283335 commented on a change in pull request #3887: Feature 3185 add nacos center

2020-01-07 Thread GitBox
wgy8283335 commented on a change in pull request #3887: Feature 3185 add nacos 
center
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3887#discussion_r363707170
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-nacos/src/main/resources/META-INF/services/org.apache.shardingsphere.orchestration.center.api.ConfigCenter
 ##
 @@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+org.apache.shardingsphere.orchestration.center.instance.NacosInstance
 
 Review comment:
   Where is follow items:
   
org.apache.shardingsphere.orchestration.center.instance.CuratorZookeeperInstance
   org.apache.shardingsphere.orchestration.center.instance.ApolloInstance


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] coveralls commented on issue #3891: fix NullPointException for resultSetMetaData.getTableName of Proxy

2020-01-07 Thread GitBox
coveralls commented on issue #3891: fix NullPointException for 
resultSetMetaData.getTableName of Proxy
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3891#issuecomment-571549664
 
 
   ## Pull Request Test Coverage Report for [Build 
1281](https://coveralls.io/builds/27955089)
   
   * **4** of **5**   **(80.0%)**  changed or added relevant lines in **1** 
file are covered.
   * No unchanged relevant lines lost coverage.
   * Overall coverage increased (+**0.002%**) to **65.717%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-|--||---: |
   | 
[sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/response/query/QueryHeader.java](https://coveralls.io/builds/27955089/source?filename=sharding-proxy%2Fsharding-proxy-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fshardingproxy%2Fbackend%2Fresponse%2Fquery%2FQueryHeader.java#L73)
 | 4 | 5 | 80.0%
   
   
   
   |  Totals | [![Coverage 
Status](https://coveralls.io/builds/27955089/badge)](https://coveralls.io/builds/27955089)
 |
   | :-- | --: |
   | Change from base [Build 655](https://coveralls.io/builds/27954462): |  
0.002% |
   | Covered Lines: | 10723 |
   | Relevant Lines: | 16317 |
   
   ---
   # 💛  - [Coveralls](https://coveralls.io)
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] wgy8283335 commented on a change in pull request #3887: Feature 3185 add nacos center

2020-01-07 Thread GitBox
wgy8283335 commented on a change in pull request #3887: Feature 3185 add nacos 
center
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3887#discussion_r363711641
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-nacos/src/test/java/org/apache/shardingsphere/orchestration/center/instance/NacosInstanceTest.java
 ##
 @@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.orchestration.center.instance;
+
+import com.alibaba.nacos.api.config.ConfigService;
+import com.alibaba.nacos.api.config.listener.Listener;
+import java.lang.reflect.Field;
+import java.util.Properties;
+import lombok.SneakyThrows;
+import org.apache.shardingsphere.orchestration.center.api.ConfigCenter;
+import 
org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
+import 
org.apache.shardingsphere.orchestration.center.listener.DataChangedEvent;
+import 
org.apache.shardingsphere.orchestration.center.listener.DataChangedEventListener;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class NacosInstanceTest {
+
+private static ConfigCenter nacosConfigCenter = new NacosInstance();
+
+private ConfigService configService = mock(ConfigService.class);
+
+private String group = "SHARDING_SPHERE_DEFAULT_GROUP";
+
+@Before
+public void init() {
+Properties properties = new Properties();
+properties.setProperty("group", group);
+properties.setProperty("timeout", "3000");
+InstanceConfiguration configuration = new 
InstanceConfiguration(nacosConfigCenter.getType(), properties);
+configuration.setServerLists("x.x.x.:8848");
 
 Review comment:
   “x.x.x.” or "192.168.1.2"?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] tristaZero merged pull request #3891: fix NullPointException for resultSetMetaData.getTableName of Proxy

2020-01-07 Thread GitBox
tristaZero merged pull request #3891: fix NullPointException for 
resultSetMetaData.getTableName of Proxy
URL: https://github.com/apache/incubator-shardingsphere/pull/3891
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] wgy8283335 commented on a change in pull request #3887: Feature 3185 add nacos center

2020-01-07 Thread GitBox
wgy8283335 commented on a change in pull request #3887: Feature 3185 add nacos 
center
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3887#discussion_r363711927
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-nacos/src/test/java/org/apache/shardingsphere/orchestration/center/instance/NacosInstanceTest.java
 ##
 @@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.orchestration.center.instance;
+
+import com.alibaba.nacos.api.config.ConfigService;
+import com.alibaba.nacos.api.config.listener.Listener;
+import java.lang.reflect.Field;
+import java.util.Properties;
+import lombok.SneakyThrows;
+import org.apache.shardingsphere.orchestration.center.api.ConfigCenter;
+import 
org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
+import 
org.apache.shardingsphere.orchestration.center.listener.DataChangedEvent;
+import 
org.apache.shardingsphere.orchestration.center.listener.DataChangedEventListener;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class NacosInstanceTest {
+
+private static ConfigCenter nacosConfigCenter = new NacosInstance();
+
+private ConfigService configService = mock(ConfigService.class);
+
+private String group = "SHARDING_SPHERE_DEFAULT_GROUP";
+
+@Before
+public void init() {
+Properties properties = new Properties();
+properties.setProperty("group", group);
+properties.setProperty("timeout", "3000");
+InstanceConfiguration configuration = new 
InstanceConfiguration(nacosConfigCenter.getType(), properties);
+configuration.setServerLists("x.x.x.:8848");
+nacosConfigCenter.init(configuration);
+setConfigService(configService);
+}
+
+@SneakyThrows
+private void setConfigService(final ConfigService configService) {
+Field configServiceField = 
NacosInstance.class.getDeclaredField("configService");
+configServiceField.setAccessible(true);
+configServiceField.set(nacosConfigCenter, configService);
+}
+
+@Test
+@SneakyThrows
+public void assertPersist() {
+String value = "value";
+nacosConfigCenter.persist("sharding/test", value);
+verify(configService).publishConfig("sharding.test", group, value);
+}
+
+@Test
+@SneakyThrows
+public void assertGet() {
+String value = "value";
+when(configService.getConfig(eq("sharding.test"), eq(group), 
anyLong())).thenReturn(value);
+Assert.assertEquals(value, nacosConfigCenter.get("sharding/test"));
+}
+
+@Test
+@SneakyThrows
+public void assertWatch() {
+final String expectValue = "expectValue";
+final String[] actualValue = {null};
+
doAnswer(getListenerAnswer(expectValue)).when(configService).addListener(anyString(),
 anyString(), any(Listener.class));
+DataChangedEventListener listener = new DataChangedEventListener() {
+@Override
+public void onChange(final DataChangedEvent dataChangedEvent) {
+actualValue[0] = dataChangedEvent.getValue();
+}
+};
+nacosConfigCenter.watch("sharding/test", listener);
+Assert.assertEquals(expectValue, actualValue[0]);
+}
+
+private Answer getListenerAnswer(final String expectValue) {
+return new Answer() {
+@Override
+public Object answer(final InvocationOnMock invocation) {
+Listener listener = invocation.getArgument(2);
+listener.receiveConfigInfo(expectValue);
+return null;
 

[GitHub] [incubator-shardingsphere] SteNicholas opened a new pull request #3892: Insert clause sharding column null exception

2020-01-07 Thread GitBox
SteNicholas opened a new pull request #3892: Insert clause sharding column null 
exception
URL: https://github.com/apache/incubator-shardingsphere/pull/3892
 
 
   Fixes #3880. 
   
   Method `createShardingCondition` of `InsertClauseShardingConditionEngine ` 
couldn't handle the situation that `ExpressionSegment` of null value in literal 
insert SQL is `CommonExpressionSegment`. Therefore, null value doesn't add to 
shardingValues and also not throw exception.
   
   Changes proposed in this pull request:
   - Method `createShardingCondition` of `InsertClauseShardingConditionEngine ` 
adds null expression judgement and throws exception.
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] affiliate opened a new issue #3893: Need spring xml configuration of hint strategy sample

2020-01-07 Thread GitBox
affiliate opened a new issue #3893: Need spring xml configuration of hint 
strategy sample
URL: https://github.com/apache/incubator-shardingsphere/issues/3893
 
 
   Need spring xml configuration of hint strategy sample
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] terrymanu commented on issue #3893: Need spring xml configuration of hint strategy sample

2020-01-07 Thread GitBox
terrymanu commented on issue #3893: Need spring xml configuration of hint 
strategy sample
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3893#issuecomment-571611781
 
 
   Can you close this issue and create the same on in the example repo[1]?
   
   [1] https://github.com/apache/incubator-shardingsphere-example/issues


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion merged pull request #3892: Insert clause sharding column null exception

2020-01-07 Thread GitBox
KomachiSion merged pull request #3892: Insert clause sharding column null 
exception
URL: https://github.com/apache/incubator-shardingsphere/pull/3892
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion closed issue #3884: Insert SQL with null value of shardingColumns may be routed to multiple dataNodes.

2020-01-07 Thread GitBox
KomachiSion closed issue #3884: Insert SQL with null value of shardingColumns 
may be routed to multiple dataNodes.
URL: https://github.com/apache/incubator-shardingsphere/issues/3884
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] beckhampu merged pull request #3888: modify sharding-ui-backend module for orchestration.

2020-01-07 Thread GitBox
beckhampu merged pull request #3888: modify sharding-ui-backend module for 
orchestration.
URL: https://github.com/apache/incubator-shardingsphere/pull/3888
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-shardingsphere-benchmark] branch master updated: for performance

2020-01-07 Thread zhaoyanan
This is an automated email from the ASF dual-hosted git repository.

zhaoyanan pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-shardingsphere-benchmark.git


The following commit(s) were added to refs/heads/master by this push:
 new 1f74df9  for performance
1f74df9 is described below

commit 1f74df9ee0945b9e83467a6f61f032abbbc2737e
Author: nancyzrh 
AuthorDate: Wed Jan 8 09:03:15 2020 +0800

for performance
---
 report/data/3.0_single_delete_merge.log_plot| 1 +
 report/data/3.0_single_insert_merge.log_plot| 1 +
 report/data/3.0_single_select_merge.log_plot| 1 +
 report/data/3.0_single_update_merge.log_plot| 1 +
 report/data/3.0_sp_delete_raw_merge.log_plot| 1 +
 report/data/3.0_sp_insert_raw_merge.log_plot| 1 +
 report/data/3.0_sp_select_raw_merge.log_plot| 1 +
 report/data/3.0_sp_update_raw_merge.log_plot| 1 +
 report/data/4.0_single_delete_merge.log_plot| 1 +
 report/data/4.0_single_insert_merge.log_plot| 1 +
 report/data/4.0_single_update_merge.log_plot| 1 +
 report/data/4.0_sp_delete_raw_merge.log_plot| 1 +
 report/data/4.0_sp_insert_raw_merge.log_plot| 1 +
 report/data/4.0_sp_update_raw_merge.log_plot| 1 +
 report/data/direct_delete_merge.log_plot| 1 +
 report/data/direct_update_merge.log_plot| 1 +
 report/data/encrypt/4.0_sp_delete_enc.log_plot  | 1 +
 report/data/encrypt/4.0_sp_delete_enc_sharding.log_plot | 1 +
 report/data/encrypt/4.0_sp_insert_enc.log_plot  | 1 +
 report/data/encrypt/4.0_sp_insert_enc_sharding.log_plot | 1 +
 report/data/encrypt/4.0_sp_update_enc.log_plot  | 1 +
 report/data/encrypt/4.0_sp_update_enc_sharding.log_plot | 1 +
 report/data/jdbc/3.0_sj_ms_delete.log_plot  | 1 +
 report/data/jdbc/3.0_sj_ms_insert.log_plot  | 1 +
 report/data/jdbc/3.0_sj_ms_select.log_plot  | 1 +
 report/data/jdbc/3.0_sj_ms_sharding_delete.log_plot | 1 +
 report/data/jdbc/3.0_sj_ms_sharding_insert.log_plot | 1 +
 report/data/jdbc/3.0_sj_ms_sharding_update.log_plot | 1 +
 report/data/jdbc/3.0_sj_sharding_delete.log_plot| 1 +
 report/data/jdbc/3.0_sj_sharding_insert.log_plot| 1 +
 report/data/jdbc/3.0_sj_sharding_update.log_plot| 1 +
 report/data/jdbc/4.0_sj_delete_raw.log_plot | 1 +
 report/data/jdbc/4.0_sj_enc_delete.log_plot | 1 +
 report/data/jdbc/4.0_sj_enc_delete_sharding.log_plot| 1 +
 report/data/jdbc/4.0_sj_enc_insert.log_plot | 1 +
 report/data/jdbc/4.0_sj_enc_insert_sharding.log_plot| 1 +
 report/data/jdbc/4.0_sj_enc_update.log_plot | 1 +
 report/data/jdbc/4.0_sj_enc_update_sharding.log_plot| 1 +
 report/data/jdbc/4.0_sj_insert_raw.log_plot | 1 +
 report/data/jdbc/4.0_sj_ms_delete.log_plot  | 1 +
 report/data/jdbc/4.0_sj_ms_insert.log_plot  | 1 +
 report/data/jdbc/4.0_sj_ms_sharding_delete.log_plot | 1 +
 report/data/jdbc/4.0_sj_ms_sharding_insert.log_plot | 1 +
 report/data/jdbc/4.0_sj_ms_sharding_update.log_plot | 1 +
 report/data/jdbc/4.0_sj_ms_update.log_plot  | 1 +
 report/data/jdbc/4.0_sj_sharding_delete.log_plot| 1 +
 report/data/jdbc/4.0_sj_sharding_insert.log_plot| 1 +
 report/data/jdbc/4.0_sj_sharding_update.log_plot| 1 +
 report/data/jdbc/4.0_sj_update_raw.log_plot | 1 +
 report/data/master_slave/3.0_sp_delete_ms.log_plot  | 1 +
 report/data/master_slave/3.0_sp_delete_ms_sharding.log_plot | 1 +
 report/data/master_slave/3.0_sp_insert_ms.log_plot  | 1 +
 report/data/master_slave/3.0_sp_insert_ms_sharding.log_plot | 1 +
 report/data/master_slave/3.0_sp_select_ms.log_plot  | 1 +
 report/data/master_slave/3.0_sp_select_ms_sharding.log_plot | 1 +
 report/data/master_slave/3.0_sp_update_ms.log_plot  | 1 +
 report/data/master_slave/3.0_sp_update_ms_sharding.log_plot | 1 +
 report/data/master_slave/4.0_sp_delete_ms.log_plot  | 1 +
 report/data/master_slave/4.0_sp_delete_ms_sharding.log_plot | 1 +
 report/data/master_slave/4.0_sp_insert_ms.log_plot  | 1 +
 report/data/master_slave/4.0_sp_insert_ms_sharding.log_plot | 1 +
 report/data/master_slave/4.0_sp_update_ms.log_plot  | 1 +
 report/data/master_slave/4.0_sp_update_ms_sharding.log_plot | 1 +
 report/jtl_json/full_route_test.json| 2 +-
 report/jtl_json/master_slave_encrypt_sharding_test.json | 2 +-
 report/jtl_json/master_slave_test.json  | 2 +-
 report/jtl_json/single_route_test.json  | 2 +-
 67 files changed, 67 insertions(+), 

[GitHub] [incubator-shardingsphere] lssprogress edited a comment on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
lssprogress edited a comment on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571400257
 
 
   > Can you provide the log of `sql.show` and your sharding rule configuration?
   
   **config:**
   ```
   
spring.shardingsphere.sharding.tables.tunnel_order.actual-data-nodes=ds0.tunnel_order$->{2016..2020}$->{1..4}
   
spring.shardingsphere.sharding.tables.tunnel_order.table-strategy.standard.sharding-column=create_date
   
spring.shardingsphere.sharding.tables.tunnel_order.table-strategy.standard.precise-algorithm-class-name=config.OrderTableShardingAlgorithm
   
spring.shardingsphere.sharding.tables.tunnel_order.table-strategy.standard.range-algorithm-class-name=config.OrderTableShardingAlgorithm
   ```
   
   **code:**
   ```
   tunnelOrderQueryWrapper.select("ifnull(sum(act_amount),0) as 
amount","pay_type")
   .eq("order_status", 
SysParamConstaint.OrderStatus.ORDER_STATUS_PAY_SUCCESS.getValue())
   .eq("date_format(pay_success_time,'%Y-%m-%d')", 
GlobalUtil.formatDateStr(date, "-MM-dd"))
   .eq("logic_delete", 
SysParamConstaint.DeletedStatus.NOT_DELETED.getValue())
   .eq("order_type", 
SysParamConstaint.TunnelOrderType.ORDER_TYPE_SUIETONG_QRCODE.getValue())
   .between("create_date", 
GlobalUtil.formatDateStr(GlobalUtil.dealDateByNum(date,-1),"-MM-dd")
   
,GlobalUtil.formatDateStr(GlobalUtil.dealDateByNum(date,1),"-MM-dd"))
   .groupBy("pay_type");
   List> result = 
tunnelOrderMapper.selectMaps(tunnelOrderQueryWrapper);
   ```
   **log:**
   ```
   2020-01-07 09:53:22.371  INFO 13164 --- [nio-7081-exec-1] ShardingSphere-SQL 
  : Logic SQL: SELECT  
   ifnull(sum(act_amount),0) as amount,pay_type
 FROM tunnel_order 

WHERE (order_status = ? AND date_format(pay_success_time,'%Y-%m-%d') = ? 
AND logic_delete = ? AND order_type = ? AND create_date BETWEEN ? AND ?) GROUP 
BY pay_type
   2020-01-07 09:53:22.371  INFO 13164 --- [nio-7081-exec-1] ShardingSphere-SQL 
  : SQLStatement: 
SelectStatement(super=DQLStatement(super=AbstractSQLStatement(type=DQL, 
tables=Tables(tables=[Table(name=tunnel_order, alias=Optional.absent())]), 
routeConditions=Conditions(orCondition=OrCondition(andConditions=[AndCondition(conditions=[Condition(column=Column(name=create_date,
 tableName=tunnel_order), operator=BETWEEN, compareOperator=null, 
positionValueMap={}, positionIndexMap={0=4, 1=5})])])), 
encryptConditions=Conditions(orCondition=OrCondition(andConditions=[])), 
sqlTokens=[TableToken(tableName=tunnel_order, quoteCharacter=NONE, 
schemaNameLength=0), SQLToken(startIndex=241)], parametersIndex=6, 
logicSQL=SELECT  
   ifnull(sum(act_amount),0) as amount,pay_type
 FROM tunnel_order 

WHERE (order_status = ? AND date_format(pay_success_time,'%Y-%m-%d') = ? 
AND logic_delete = ? AND order_type = ? AND create_date BETWEEN ? AND ?) GROUP 
BY pay_type)), containStar=false, firstSelectItemStartIndex=9, 
selectListStopIndex=52, groupByLastIndex=240, 
items=[CommonSelectItem(expression=ifnull(sum(act_amount),0), 
alias=Optional.of(amount)), CommonSelectItem(expression=pay_type, 
alias=Optional.absent())], groupByItems=[OrderItem(owner=Optional.absent(), 
name=Optional.of(pay_type), orderDirection=ASC, nullOrderDirection=ASC, 
index=2, expression=null, alias=Optional.absent())], 
orderByItems=[OrderItem(owner=Optional.absent(), name=Optional.of(pay_type), 
orderDirection=ASC, nullOrderDirection=ASC, index=2, expression=null, 
alias=Optional.absent())], limit=null, subqueryStatement=null, 
subqueryStatements=[], subqueryConditions=[])
   2020-01-07 09:53:22.371  INFO 13164 --- [nio-7081-exec-1] ShardingSphere-SQL 
  : Actual SQL: ds0 ::: SELECT  
   ifnull(sum(act_amount),0) as amount,pay_type
 FROM tunnel_order20194 

WHERE (order_status = ? AND date_format(pay_success_time,'%Y-%m-%d') = ? 
AND logic_delete = ? AND order_type = ? AND create_date BETWEEN ? AND ?) GROUP 
BY pay_type ORDER BY pay_type ASC  ::: [1, 2019-12-31, 0, 1, 2019-12-30, 
2020-01-01]
   2020-01-07 09:53:22.371  INFO 13164 --- [nio-7081-exec-1] ShardingSphere-SQL 
  : Actual SQL: ds0 ::: SELECT  
   ifnull(sum(act_amount),0) as amount,pay_type
 FROM tunnel_order20201 

WHERE (order_status = ? AND date_format(pay_success_time,'%Y-%m-%d') = ? 
AND logic_delete = ? AND order_type = ? AND create_date BETWEEN ? AND ?) GROUP 
BY pay_type ORDER BY pay_type ASC  ::: [1, 2019-12-31, 0, 1, 2019-12-30, 
2020-01-01]
   2020-01-07 09:53:22.378  INFO 13164 --- [nio-7081-exec-1] 结果:[{amount=1000, 
pay_type=0}, {amount=1000, pay_type=1}]
   
   ```
   


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

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
KomachiSion commented on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571853200
 
 
   @lssprogress Would you mind provide these two information to help us 
reproduce problem?
   
   1. table structure and init datas in `tunnel_order20194` and 
`tunnel_order20201`
   2. `config.OrderTableShardingAlgorithm` algorithm code.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion edited a comment on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
KomachiSion edited a comment on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571853200
 
 
   @lssprogress Would you mind provide these two information to help us 
reproduce problem?
   
   1. table structure and init datas in `tunnel_order20194` and 
`tunnel_order20201`, you can avoid sensitive information.
   2. `config.OrderTableShardingAlgorithm` algorithm code.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] lssprogress commented on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
lssprogress commented on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571854937
 
 
   > 1. table structure and init datas in `tunnel_order20194` and 
`tunnel_order20201`, you can avoid sensitive information.
   
   How can I provide it to you?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
KomachiSion commented on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571856043
 
 
   Put them to comment.
   If the content is too much, you can upload to github repo, and provide repo 
address in the comments.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] zzeverglow commented on issue #3852: shardingjdcb 4.0.0-rc2 cannot convert sqlserver timestamp field

2020-01-07 Thread GitBox
zzeverglow commented on issue #3852: shardingjdcb 4.0.0-rc2 cannot convert 
sqlserver timestamp field
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3852#issuecomment-571859539
 
 
   > @zzeverglow , what's your sqlserver version and the table structure info, 
can you provide a github project about this problem, I will recurrent the 
problem on my dev environment. Thanks.
   
   Sqlserver version is 2012.   A timestamp field in the table cause the 
exception. Sorry i cant provide the project in github becasue it is a project 
of the company where i am working in.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] sunbufu commented on a change in pull request #3887: Feature 3185 add nacos center

2020-01-07 Thread GitBox
sunbufu commented on a change in pull request #3887: Feature 3185 add nacos 
center
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3887#discussion_r364040884
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-nacos/src/main/java/org/apache/shardingsphere/orchestration/center/instance/NacosInstance.java
 ##
 @@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.orchestration.center.instance;
+
+import com.alibaba.nacos.api.NacosFactory;
+import com.alibaba.nacos.api.config.ConfigService;
+import com.alibaba.nacos.api.config.listener.Listener;
+import com.alibaba.nacos.api.exception.NacosException;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Executor;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.orchestration.center.api.ConfigCenter;
+import 
org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
+import 
org.apache.shardingsphere.orchestration.center.listener.DataChangedEvent;
+import 
org.apache.shardingsphere.orchestration.center.listener.DataChangedEventListener;
+
+/**
+ * The nacos instance for ConfigCenter.
+ *
+ * @author huangjian
+ * @author sunbufu
+ */
+@Slf4j
+public class NacosInstance implements ConfigCenter {
+
+private final String defaultGroup = "SHARDING_SPHERE_DEFAULT_GROUP";
+
+private ConfigService configService;
+
+@Getter
+@Setter
+private Properties properties = new Properties();
+
+/**
+ * Initialize nacos instance.
+ *
+ * @param config config center configuration
+ */
+@Override
+public void init(final InstanceConfiguration config) {
+try {
+Properties properties = new Properties();
+properties.put("serverAddr", config.getServerLists());
+properties.put("namespace", null == config.getNamespace() ? "" : 
config.getNamespace());
+configService = NacosFactory.createConfigService(properties);
+} catch (final NacosException ex) {
+log.debug("exception for: {}", ex.toString());
+}
+}
+
+/**
+ * Get data from nacos instance.
+ *
+ * @param key key of data
+ * @return value of data
+ */
+@Override
+public String get(final String key) {
+return getDirectly(key);
+}
+
+private String getDirectly(final String key) {
+try {
+String dataId = key.replace("/", ".");
+String group = properties.getProperty("group", defaultGroup);
+long timeoutMs = Long.parseLong(properties.getProperty("timeout", 
"3000"));
+return configService.getConfig(dataId, group, timeoutMs);
+} catch (final NacosException ex) {
+log.debug("exception for: {}", ex.toString());
+return null;
+}
+}
+
+/**
+ * Get node's sub-nodes list.
+ *
+ * @param key key of data
+ * @return sub-nodes name list
+ */
+@Override
+public List getChildrenKeys(final String key) {
 
 Review comment:
   Yes, I think here need @dongzl 's new solution.  😊 But now, I just move the 
old nacos module in here.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] sunbufu commented on a change in pull request #3887: Feature 3185 add nacos center

2020-01-07 Thread GitBox
sunbufu commented on a change in pull request #3887: Feature 3185 add nacos 
center
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3887#discussion_r364041736
 
 

 ##
 File path: 
sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-nacos/src/main/resources/META-INF/services/org.apache.shardingsphere.orchestration.center.api.ConfigCenter
 ##
 @@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+org.apache.shardingsphere.orchestration.center.instance.NacosInstance
 
 Review comment:
   This module is a sub module of `sharding-orchestration-center`, and 
different instance module only have itself instance in here. 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] lssprogress commented on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
lssprogress commented on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571868530
 
 
   @Slf4j
   public class OrderTableShardingAlgorithm implements 
PreciseShardingAlgorithm, RangeShardingAlgorithm {
   
   @Override
   public String doSharding(Collection collection, 
PreciseShardingValue preciseShardingValue) {
   String tableNode=null;
   Date createDate = 
DateUtil.parseDateFromStrYyyyMMdd2(preciseShardingValue.getValue());
   Calendar c = Calendar.getInstance();
   c.setTime(createDate);
   int year = c.get(Calendar.YEAR);
   int season = DateUtil.getSeason(createDate);
   
   log.debug("按照季度进行数据分片,精准查询,当前为第{}年,第{}季度:",year,season);
   for(Object obj:collection){
   String oneNode=obj+"";
   if(oneNode.endsWith(year+""+season)){
   tableNode = oneNode;
   break;
   }
   }
   
  return tableNode;
   }
   
   @Override
   public Collection doSharding(Collection collection, 
RangeShardingValue rangeShardingValue) {
   Collection collect = new ArrayList<>();
   Calendar calendar=Calendar.getInstance();
   String 
dateUpperStr=rangeShardingValue.getValueRange().upperEndpoint();
   String 
dateLowerStr=rangeShardingValue.getValueRange().lowerEndpoint();
   Date dateUpper=DateUtil.parseDateFromStrYyyyMMdd2(dateUpperStr);
   Date dateLower=DateUtil.parseDateFromStrYyyyMMdd2(dateLowerStr);
   
   calendar.setTime(dateUpper);
   int yearUpper=calendar.get(Calendar.YEAR);
   int seasonUpper = DateUtil.getSeason(dateUpper);
   
   calendar.setTime(dateLower);
   int yearLower=calendar.get(Calendar.YEAR);
   int seasonLower = DateUtil.getSeason(dateLower);
   boolean add = false;
   for(String obj:collection){
   String tableNoe=obj+"";
   if(!add){
   if(tableNoe.endsWith(yearLower+""+seasonLower)){
   add = true;
   }
   }
   if(tableNoe.endsWith(yearUpper+""+seasonUpper)){
   collect.add(tableNoe);
   break;
   }
   if(add){
   collect.add(tableNoe);
   }
   }
   log.debug("按照季度进行数据分片,范围查询,当前范围:{}", JSONUtil.parseArray(collect));
   return collect;
   }
   }


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] lssprogress removed a comment on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
lssprogress removed a comment on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571868530
 
 
   @Slf4j
   public class OrderTableShardingAlgorithm implements 
PreciseShardingAlgorithm, RangeShardingAlgorithm {
   
   @Override
   public String doSharding(Collection collection, 
PreciseShardingValue preciseShardingValue) {
   String tableNode=null;
   Date createDate = 
DateUtil.parseDateFromStrYyyyMMdd2(preciseShardingValue.getValue());
   Calendar c = Calendar.getInstance();
   c.setTime(createDate);
   int year = c.get(Calendar.YEAR);
   int season = DateUtil.getSeason(createDate);
   
   log.debug("按照季度进行数据分片,精准查询,当前为第{}年,第{}季度:",year,season);
   for(Object obj:collection){
   String oneNode=obj+"";
   if(oneNode.endsWith(year+""+season)){
   tableNode = oneNode;
   break;
   }
   }
   
  return tableNode;
   }
   
   @Override
   public Collection doSharding(Collection collection, 
RangeShardingValue rangeShardingValue) {
   Collection collect = new ArrayList<>();
   Calendar calendar=Calendar.getInstance();
   String 
dateUpperStr=rangeShardingValue.getValueRange().upperEndpoint();
   String 
dateLowerStr=rangeShardingValue.getValueRange().lowerEndpoint();
   Date dateUpper=DateUtil.parseDateFromStrYyyyMMdd2(dateUpperStr);
   Date dateLower=DateUtil.parseDateFromStrYyyyMMdd2(dateLowerStr);
   
   calendar.setTime(dateUpper);
   int yearUpper=calendar.get(Calendar.YEAR);
   int seasonUpper = DateUtil.getSeason(dateUpper);
   
   calendar.setTime(dateLower);
   int yearLower=calendar.get(Calendar.YEAR);
   int seasonLower = DateUtil.getSeason(dateLower);
   boolean add = false;
   for(String obj:collection){
   String tableNoe=obj+"";
   if(!add){
   if(tableNoe.endsWith(yearLower+""+seasonLower)){
   add = true;
   }
   }
   if(tableNoe.endsWith(yearUpper+""+seasonUpper)){
   collect.add(tableNoe);
   break;
   }
   if(add){
   collect.add(tableNoe);
   }
   }
   log.debug("按照季度进行数据分片,范围查询,当前范围:{}", JSONUtil.parseArray(collect));
   return collect;
   }
   }


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] lssprogress commented on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
lssprogress commented on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571870074
 
 
   > Put them to comment.
   > If the content is too much, you can upload to github repo, and provide 
repo address in the comments.
   
   @Slf4j
   public class OrderTableShardingAlgorithm implements 
PreciseShardingAlgorithm, RangeShardingAlgorithm {
   
   @Override
   public String doSharding(Collection collection, 
PreciseShardingValue preciseShardingValue) {
   String tableNode=null;
   Date createDate = 
DateUtil.parseDateFromStrYyyyMMdd2(preciseShardingValue.getValue());
   Calendar c = Calendar.getInstance();
   c.setTime(createDate);
   int year = c.get(Calendar.YEAR);
   int season = DateUtil.getSeason(createDate);
   
   log.debug("按照季度进行数据分片,精准查询,当前为第{}年,第{}季度:",year,season);
   for(Object obj:collection){
   String oneNode=obj+"";
   if(oneNode.endsWith(year+""+season)){
   tableNode = oneNode;
   break;
   }
   }
   
  return tableNode;
   }
   
   @Override
   public Collection doSharding(Collection collection, 
RangeShardingValue rangeShardingValue) {
   Collection collect = new ArrayList<>();
   Calendar calendar=Calendar.getInstance();
   String 
dateUpperStr=rangeShardingValue.getValueRange().upperEndpoint();
   String 
dateLowerStr=rangeShardingValue.getValueRange().lowerEndpoint();
   Date dateUpper=DateUtil.parseDateFromStrYyyyMMdd2(dateUpperStr);
   Date dateLower=DateUtil.parseDateFromStrYyyyMMdd2(dateLowerStr);
   
   calendar.setTime(dateUpper);
   int yearUpper=calendar.get(Calendar.YEAR);
   int seasonUpper = DateUtil.getSeason(dateUpper);
   
   calendar.setTime(dateLower);
   int yearLower=calendar.get(Calendar.YEAR);
   int seasonLower = DateUtil.getSeason(dateLower);
   boolean add = false;
   for(String obj:collection){
   String tableNoe=obj+"";
   if(!add){
   if(tableNoe.endsWith(yearLower+""+seasonLower)){
   add = true;
   }
   }
   if(tableNoe.endsWith(yearUpper+""+seasonUpper)){
   collect.add(tableNoe);
   break;
   }
   if(add){
   collect.add(tableNoe);
   }
   }
   log.debug("按照季度进行数据分片,范围查询,当前范围:{}", JSONUtil.parseArray(collect));
   return collect;
   }
   }
   
   
   CREATE TABLE tunnel_order20194 (
 id bigint(20) NOT NULL AUTO_INCREMENT,
 line_order_id varchar(50) DEFAULT NULL,
 line_no int(11) DEFAULT NULL COMMENT,
 plate_no varchar(10) DEFAULT NULL,
 plate_color varchar(2) DEFAULT NULL,
 pay_type char(1) DEFAULT NULL,
 carry_cnt int(11) DEFAULT NULL,
 vehicle_type char(1) DEFAULT NULL,
 pay_amount int(11) DEFAULT NULL,
 act_amount int(11) DEFAULT NULL,
 coupon_amount int(11) DEFAULT NULL,
 order_status char(1) DEFAULT NULL,
 pay_time datetime DEFAULT NULL,
 pay_success_time datetime DEFAULT NULL,
 pass_time datetime DEFAULT NULL,
 shift char(1) DEFAULT NULL,
 shift_date varchar(10) DEFAULT NULL,
 order_type char(1) DEFAULT NULL,
 charger_id varchar(32) DEFAULT NULL,
 charger_name varchar(20) DEFAULT NULL,
 vehicle_id varchar(32) DEFAULT NULL,
 user_id varchar(32) DEFAULT NULL,
 user_name varchar(50) DEFAULT NULL,
 pay_order_no varchar(32) DEFAULT NULL,
 offline_record_id varchar(50) DEFAULT NULL,
 is_lease char(1) DEFAULT 'N',
 img_url varchar(50) DEFAULT NULL',
 create_by varchar(30) DEFAULT NULL,
 create_time datetime DEFAULT NULL',
 update_by varchar(30) DEFAULT NULL,
 update_time datetime DEFAULT NULL,
 logic_delete char(1) DEFAULT '0',
 create_date varchar(10) DEFAULT NULL,
 obu_id varchar(50) DEFAULT NULL,
 fee_seri_no varchar(32) DEFAULT NULL
   )
   ENGINE = INNODB
   CHARACTER SET utf8
   COLLATE utf8_general_ci;
   
   CREATE TABLE tunnel_order20201 (
 id bigint(20) NOT NULL AUTO_INCREMENT,
 line_order_id varchar(50) DEFAULT NULL,
 line_no int(11) DEFAULT NULL COMMENT,
 plate_no varchar(10) DEFAULT NULL,
 plate_color varchar(2) DEFAULT NULL,
 pay_type char(1) DEFAULT NULL,
 carry_cnt int(11) DEFAULT NULL,
 vehicle_type char(1) DEFAULT NULL,
 pay_amount int(11) DEFAULT NULL,
 act_amount int(11) DEFAULT NULL,
 coupon_amount int(11) DEFAULT NULL,
 order_status char(1) DEFAULT NULL,
 pay_time datetime DEFAULT NULL,
 pay_success_time datetime DEFAULT NULL,
 pass_time datetime DEFAULT NULL,
 shift char(1) DEFAULT NULL,
 shift_date varchar(10) DEFAULT NULL,
 order_type char(1) DEFAULT NULL,
 cha

[GitHub] [incubator-shardingsphere] ssxlulu opened a new pull request #3894: Use spi for datasources check

2020-01-07 Thread GitBox
ssxlulu opened a new pull request #3894: Use spi for datasources check
URL: https://github.com/apache/incubator-shardingsphere/pull/3894
 
 
   Fixes #3849.
   
   Changes proposed in this pull request:
   - Use spi for datasources check


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] SteNicholas opened a new pull request #3895: Insert clause sharding column null text judgement

2020-01-07 Thread GitBox
SteNicholas opened a new pull request #3895: Insert clause sharding column null 
text judgement
URL: https://github.com/apache/incubator-shardingsphere/pull/3895
 
 
   Fixes #3884.
   
   Method `createShardingCondition` of `InsertClauseShardingConditionEngine` 
couldn't handle the situation that `ExpressionSegment` of null value in literal 
insert SQL is `CommonExpressionSegment`, and text of `CommonExpressionSegment` 
is "null".
   
   Changes proposed in this pull request:
   
   - Method `createShardingCondition` of InsertClauseShardingConditionEngine 
modify null expression judgement with "null" text.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] nancyzrh commented on issue #3895: Insert clause sharding column null text judgement

2020-01-07 Thread GitBox
nancyzrh commented on issue #3895: Insert clause sharding column null text 
judgement
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3895#issuecomment-571874844
 
 
   /run ci


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] lssprogress edited a comment on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
lssprogress edited a comment on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571870074
 
 
   > Put them to comment.
   > If the content is too much, you can upload to github repo, and provide 
repo address in the comments.
   
   ```java
   @Slf4j
   public class OrderTableShardingAlgorithm implements 
PreciseShardingAlgorithm, RangeShardingAlgorithm {
   
   @Override
   public String doSharding(Collection collection, 
PreciseShardingValue preciseShardingValue) {
   String tableNode=null;
   Date createDate = 
DateUtil.parseDateFromStrYyyyMMdd2(preciseShardingValue.getValue());
   Calendar c = Calendar.getInstance();
   c.setTime(createDate);
   int year = c.get(Calendar.YEAR);
   int season = DateUtil.getSeason(createDate);
   
   log.debug("按照季度进行数据分片,精准查询,当前为第{}年,第{}季度:",year,season);
   for(Object obj:collection){
   String oneNode=obj+"";
   if(oneNode.endsWith(year+""+season)){
   tableNode = oneNode;
   break;
   }
   }
   
  return tableNode;
   }
   
   @Override
   public Collection doSharding(Collection collection, 
RangeShardingValue rangeShardingValue) {
   Collection collect = new ArrayList<>();
   Calendar calendar=Calendar.getInstance();
   String 
dateUpperStr=rangeShardingValue.getValueRange().upperEndpoint();
   String 
dateLowerStr=rangeShardingValue.getValueRange().lowerEndpoint();
   Date dateUpper=DateUtil.parseDateFromStrYyyyMMdd2(dateUpperStr);
   Date dateLower=DateUtil.parseDateFromStrYyyyMMdd2(dateLowerStr);
   
   calendar.setTime(dateUpper);
   int yearUpper=calendar.get(Calendar.YEAR);
   int seasonUpper = DateUtil.getSeason(dateUpper);
   
   calendar.setTime(dateLower);
   int yearLower=calendar.get(Calendar.YEAR);
   int seasonLower = DateUtil.getSeason(dateLower);
   boolean add = false;
   for(String obj:collection){
   String tableNoe=obj+"";
   if(!add){
   if(tableNoe.endsWith(yearLower+""+seasonLower)){
   add = true;
   }
   }
   if(tableNoe.endsWith(yearUpper+""+seasonUpper)){
   collect.add(tableNoe);
   break;
   }
   if(add){
   collect.add(tableNoe);
   }
   }
   log.debug("按照季度进行数据分片,范围查询,当前范围:{}", JSONUtil.parseArray(collect));
   return collect;
   }
   }
   ```
   
   ```sql
   CREATE TABLE tunnel_order20194 (
 id bigint(20) NOT NULL AUTO_INCREMENT,
 line_order_id varchar(50) DEFAULT NULL,
 line_no int(11) DEFAULT NULL COMMENT,
 plate_no varchar(10) DEFAULT NULL,
 plate_color varchar(2) DEFAULT NULL,
 pay_type char(1) DEFAULT NULL,
 carry_cnt int(11) DEFAULT NULL,
 vehicle_type char(1) DEFAULT NULL,
 pay_amount int(11) DEFAULT NULL,
 act_amount int(11) DEFAULT NULL,
 coupon_amount int(11) DEFAULT NULL,
 order_status char(1) DEFAULT NULL,
 pay_time datetime DEFAULT NULL,
 pay_success_time datetime DEFAULT NULL,
 pass_time datetime DEFAULT NULL,
 shift char(1) DEFAULT NULL,
 shift_date varchar(10) DEFAULT NULL,
 order_type char(1) DEFAULT NULL,
 charger_id varchar(32) DEFAULT NULL,
 charger_name varchar(20) DEFAULT NULL,
 vehicle_id varchar(32) DEFAULT NULL,
 user_id varchar(32) DEFAULT NULL,
 user_name varchar(50) DEFAULT NULL,
 pay_order_no varchar(32) DEFAULT NULL,
 offline_record_id varchar(50) DEFAULT NULL,
 is_lease char(1) DEFAULT 'N',
 img_url varchar(50) DEFAULT NULL',
 create_by varchar(30) DEFAULT NULL,
 create_time datetime DEFAULT NULL',
 update_by varchar(30) DEFAULT NULL,
 update_time datetime DEFAULT NULL,
 logic_delete char(1) DEFAULT '0',
 create_date varchar(10) DEFAULT NULL,
 obu_id varchar(50) DEFAULT NULL,
 fee_seri_no varchar(32) DEFAULT NULL
   )
   ENGINE = INNODB
   CHARACTER SET utf8
   COLLATE utf8_general_ci;
   
   CREATE TABLE tunnel_order20201 (
 id bigint(20) NOT NULL AUTO_INCREMENT,
 line_order_id varchar(50) DEFAULT NULL,
 line_no int(11) DEFAULT NULL COMMENT,
 plate_no varchar(10) DEFAULT NULL,
 plate_color varchar(2) DEFAULT NULL,
 pay_type char(1) DEFAULT NULL,
 carry_cnt int(11) DEFAULT NULL,
 vehicle_type char(1) DEFAULT NULL,
 pay_amount int(11) DEFAULT NULL,
 act_amount int(11) DEFAULT NULL,
 coupon_amount int(11) DEFAULT NULL,
 order_status char(1) DEFAULT NULL,
 pay_time datetime DEFAULT NULL,
 pay_success_time datetime DEFAULT NULL,
 pass_time datetime DEFAULT NULL,
 shift char(1) DEFAULT NULL,
 shift_date varchar(10) DEFAULT NULL,
 order_type

[GitHub] [incubator-shardingsphere] lssprogress edited a comment on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
lssprogress edited a comment on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571870074
 
 
   > Put them to comment.
   > If the content is too much, you can upload to github repo, and provide 
repo address in the comments.
   
   ```
   @Slf4j
   public class OrderTableShardingAlgorithm implements 
PreciseShardingAlgorithm, RangeShardingAlgorithm {
   
   @Override
   public String doSharding(Collection collection, 
PreciseShardingValue preciseShardingValue) {
   String tableNode=null;
   Date createDate = 
DateUtil.parseDateFromStrYyyyMMdd2(preciseShardingValue.getValue());
   Calendar c = Calendar.getInstance();
   c.setTime(createDate);
   int year = c.get(Calendar.YEAR);
   int season = DateUtil.getSeason(createDate);
   
   log.debug("按照季度进行数据分片,精准查询,当前为第{}年,第{}季度:",year,season);
   for(Object obj:collection){
   String oneNode=obj+"";
   if(oneNode.endsWith(year+""+season)){
   tableNode = oneNode;
   break;
   }
   }
   
  return tableNode;
   }
   
   @Override
   public Collection doSharding(Collection collection, 
RangeShardingValue rangeShardingValue) {
   Collection collect = new ArrayList<>();
   Calendar calendar=Calendar.getInstance();
   String 
dateUpperStr=rangeShardingValue.getValueRange().upperEndpoint();
   String 
dateLowerStr=rangeShardingValue.getValueRange().lowerEndpoint();
   Date dateUpper=DateUtil.parseDateFromStrYyyyMMdd2(dateUpperStr);
   Date dateLower=DateUtil.parseDateFromStrYyyyMMdd2(dateLowerStr);
   
   calendar.setTime(dateUpper);
   int yearUpper=calendar.get(Calendar.YEAR);
   int seasonUpper = DateUtil.getSeason(dateUpper);
   
   calendar.setTime(dateLower);
   int yearLower=calendar.get(Calendar.YEAR);
   int seasonLower = DateUtil.getSeason(dateLower);
   boolean add = false;
   for(String obj:collection){
   String tableNoe=obj+"";
   if(!add){
   if(tableNoe.endsWith(yearLower+""+seasonLower)){
   add = true;
   }
   }
   if(tableNoe.endsWith(yearUpper+""+seasonUpper)){
   collect.add(tableNoe);
   break;
   }
   if(add){
   collect.add(tableNoe);
   }
   }
   log.debug("按照季度进行数据分片,范围查询,当前范围:{}", JSONUtil.parseArray(collect));
   return collect;
   }
   }
   ```
   
   ```sql
   CREATE TABLE tunnel_order20194 (
 id bigint(20) NOT NULL AUTO_INCREMENT,
 line_order_id varchar(50) DEFAULT NULL,
 line_no int(11) DEFAULT NULL COMMENT,
 plate_no varchar(10) DEFAULT NULL,
 plate_color varchar(2) DEFAULT NULL,
 pay_type char(1) DEFAULT NULL,
 carry_cnt int(11) DEFAULT NULL,
 vehicle_type char(1) DEFAULT NULL,
 pay_amount int(11) DEFAULT NULL,
 act_amount int(11) DEFAULT NULL,
 coupon_amount int(11) DEFAULT NULL,
 order_status char(1) DEFAULT NULL,
 pay_time datetime DEFAULT NULL,
 pay_success_time datetime DEFAULT NULL,
 pass_time datetime DEFAULT NULL,
 shift char(1) DEFAULT NULL,
 shift_date varchar(10) DEFAULT NULL,
 order_type char(1) DEFAULT NULL,
 charger_id varchar(32) DEFAULT NULL,
 charger_name varchar(20) DEFAULT NULL,
 vehicle_id varchar(32) DEFAULT NULL,
 user_id varchar(32) DEFAULT NULL,
 user_name varchar(50) DEFAULT NULL,
 pay_order_no varchar(32) DEFAULT NULL,
 offline_record_id varchar(50) DEFAULT NULL,
 is_lease char(1) DEFAULT 'N',
 img_url varchar(50) DEFAULT NULL',
 create_by varchar(30) DEFAULT NULL,
 create_time datetime DEFAULT NULL',
 update_by varchar(30) DEFAULT NULL,
 update_time datetime DEFAULT NULL,
 logic_delete char(1) DEFAULT '0',
 create_date varchar(10) DEFAULT NULL,
 obu_id varchar(50) DEFAULT NULL,
 fee_seri_no varchar(32) DEFAULT NULL
   )
   ENGINE = INNODB
   CHARACTER SET utf8
   COLLATE utf8_general_ci;
   
   CREATE TABLE tunnel_order20201 (
 id bigint(20) NOT NULL AUTO_INCREMENT,
 line_order_id varchar(50) DEFAULT NULL,
 line_no int(11) DEFAULT NULL COMMENT,
 plate_no varchar(10) DEFAULT NULL,
 plate_color varchar(2) DEFAULT NULL,
 pay_type char(1) DEFAULT NULL,
 carry_cnt int(11) DEFAULT NULL,
 vehicle_type char(1) DEFAULT NULL,
 pay_amount int(11) DEFAULT NULL,
 act_amount int(11) DEFAULT NULL,
 coupon_amount int(11) DEFAULT NULL,
 order_status char(1) DEFAULT NULL,
 pay_time datetime DEFAULT NULL,
 pay_success_time datetime DEFAULT NULL,
 pass_time datetime DEFAULT NULL,
 shift char(1) DEFAULT NULL,
 shift_date varchar(10) DEFAULT NULL,
 order_type cha

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3869: version:4.0.0-RC1 group by bug

2020-01-07 Thread GitBox
KomachiSion commented on issue #3869: version:4.0.0-RC1 group by bug
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3869#issuecomment-571875557
 
 
   Thanks, I will try to reproduce problem.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3894: Use spi for datasources check

2020-01-07 Thread GitBox
KomachiSion commented on issue #3894: Use spi for datasources check
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3894#issuecomment-571875746
 
 
   /run ci


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] terrymanu closed issue #3865: Create tables automatically by ddl

2020-01-07 Thread GitBox
terrymanu closed issue #3865: Create tables automatically by ddl
URL: https://github.com/apache/incubator-shardingsphere/issues/3865
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] coveralls commented on issue #3895: Insert clause sharding column null text judgement

2020-01-07 Thread GitBox
coveralls commented on issue #3895: Insert clause sharding column null text 
judgement
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3895#issuecomment-571882502
 
 
   ## Pull Request Test Coverage Report for [Build 
1282](https://coveralls.io/builds/27971721)
   
   * **0** of **1**   **(0.0%)**  changed or added relevant line in **1** file 
are covered.
   * No unchanged relevant lines lost coverage.
   * Overall coverage remained the same at **65.705%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-|--||---: |
   | 
[sharding-core/sharding-core-route/src/main/java/org/apache/shardingsphere/core/route/router/sharding/condition/ExpressionConditionUtils.java](https://coveralls.io/builds/27971721/source?filename=sharding-core%2Fsharding-core-route%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fcore%2Froute%2Frouter%2Fsharding%2Fcondition%2FExpressionConditionUtils.java#L46)
 | 0 | 1 | 0.0%
   
   
   
   |  Totals | [![Coverage 
Status](https://coveralls.io/builds/27971721/badge)](https://coveralls.io/builds/27971721)
 |
   | :-- | --: |
   | Change from base [Build 657](https://coveralls.io/builds/27970387): |  
0.0% |
   | Covered Lines: | 10723 |
   | Relevant Lines: | 16320 |
   
   ---
   # 💛  - [Coveralls](https://coveralls.io)
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion merged pull request #3895: Insert clause sharding column null text judgement

2020-01-07 Thread GitBox
KomachiSion merged pull request #3895: Insert clause sharding column null text 
judgement
URL: https://github.com/apache/incubator-shardingsphere/pull/3895
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] wenweihu86 commented on issue #3877: Could XA Transaction guarantee consistent when server instance crashed and migrated?

2020-01-07 Thread GitBox
wenweihu86 commented on issue #3877: Could XA Transaction guarantee consistent 
when server instance crashed and migrated?
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3877#issuecomment-571889377
 
 
   @cherrylzhao Could XA Transaction support save log to server, since business 
application doesn't writing log to the cloud file system most often?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion commented on a change in pull request #3894: Use spi for datasources check

2020-01-07 Thread GitBox
KomachiSion commented on a change in pull request #3894: Use spi for 
datasources check
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3894#discussion_r364062911
 
 

 ##
 File path: 
sharding-scaling/sharding-scaling-core/src/main/java/org/apache/shardingsphere/shardingscaling/core/execute/executor/checker/Checker.java
 ##
 @@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.shardingscaling.core.execute.executor.checker;
+
+/**
+ * Checker.
+ *
+ * @author ssxlulu
+ */
+public interface Checker {
 
 Review comment:
   I think `DatasourceChecker` is more readable.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion commented on a change in pull request #3894: Use spi for datasources check

2020-01-07 Thread GitBox
KomachiSion commented on a change in pull request #3894: Use spi for 
datasources check
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3894#discussion_r364062781
 
 

 ##
 File path: 
sharding-scaling/sharding-scaling-core/src/main/java/org/apache/shardingsphere/shardingscaling/core/execute/executor/checker/AbstractChecker.java
 ##
 @@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.shardingscaling.core.execute.executor.checker;
+
+import com.zaxxer.hikari.HikariDataSource;
+import lombok.AccessLevel;
+import lombok.Getter;
+import 
org.apache.shardingsphere.shardingscaling.core.exception.DatasourceCheckFailedException;
+import org.apache.shardingsphere.shardingscaling.core.util.DataSourceFactory;
+
+import java.sql.SQLException;
+
+/**
+ * generic checker implement.
+ *
+ * @author ssxlulu
+ */
+public abstract class AbstractChecker implements Checker {
+
+@Getter(AccessLevel.PROTECTED)
+private final DataSourceFactory dataSourceFactory;
+
+public AbstractChecker(final DataSourceFactory dataSourceFactory) {
+this.dataSourceFactory = dataSourceFactory;
+}
+
+@Override
+public final void checkConnection() {
+try {
+for (HikariDataSource hikariDataSource : 
dataSourceFactory.getCachedDataSources().values()) {
+hikariDataSource.getConnection();
+}
 
 Review comment:
   Why not input datasources?
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion commented on a change in pull request #3894: Use spi for datasources check

2020-01-07 Thread GitBox
KomachiSion commented on a change in pull request #3894: Use spi for 
datasources check
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3894#discussion_r364063540
 
 

 ##
 File path: 
sharding-scaling/sharding-scaling-core/src/test/java/org/apache/shardingsphere/shardingscaling/core/web/HttpServerHandlerTest.java
 ##
 @@ -66,31 +66,31 @@ public void setUp() {
 
 @Test
 public void channelReadStartFailed() {
-ByteBuf byteBuf = 
Unpooled.copiedBuffer(GSON.toJson(scalingConfiguration), CharsetUtil.UTF_8);
-fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, 
HttpMethod.POST, "/shardingscaling/job/start", byteBuf);
-httpServerHandler.channelRead0(channelHandlerContext, fullHttpRequest);
-ArgumentCaptor argumentCaptor = 
ArgumentCaptor.forClass(FullHttpResponse.class);
-verify(channelHandlerContext).writeAndFlush(argumentCaptor.capture());
-FullHttpResponse fullHttpResponse = (FullHttpResponse) 
argumentCaptor.getValue();
-
assertTrue(fullHttpResponse.content().toString(CharsetUtil.UTF_8).contains("Datasources
 check failed!"));
+//ByteBuf byteBuf = 
Unpooled.copiedBuffer(GSON.toJson(scalingConfiguration), CharsetUtil.UTF_8);
+//fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, 
HttpMethod.POST, "/shardingscaling/job/start", byteBuf);
+//httpServerHandler.channelRead0(channelHandlerContext, 
fullHttpRequest);
+//ArgumentCaptor argumentCaptor = 
ArgumentCaptor.forClass(FullHttpResponse.class);
+//
verify(channelHandlerContext).writeAndFlush(argumentCaptor.capture());
+//FullHttpResponse fullHttpResponse = (FullHttpResponse) 
argumentCaptor.getValue();
+//
assertTrue(fullHttpResponse.content().toString(CharsetUtil.UTF_8).contains("Datasources
 check failed!"));
 
 Review comment:
   Why comment unit test?
   If there are some reason have to ignore unit test, please use @Ignore 
annotation with description.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion commented on a change in pull request #3894: Use spi for datasources check

2020-01-07 Thread GitBox
KomachiSion commented on a change in pull request #3894: Use spi for 
datasources check
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3894#discussion_r364063757
 
 

 ##
 File path: 
sharding-scaling/sharding-scaling-core/src/test/java/org/apache/shardingsphere/shardingscaling/core/web/HttpServerHandlerTest.java
 ##
 @@ -66,31 +66,31 @@ public void setUp() {
 
 @Test
 public void channelReadStartFailed() {
 
 Review comment:
   Sorry, I forgot review that unit test method name should start with `assert`
   For example this test method should change to 
`assertChannelReadStartFailed()`;


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] KomachiSion commented on a change in pull request #3894: Use spi for datasources check

2020-01-07 Thread GitBox
KomachiSion commented on a change in pull request #3894: Use spi for 
datasources check
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3894#discussion_r364063540
 
 

 ##
 File path: 
sharding-scaling/sharding-scaling-core/src/test/java/org/apache/shardingsphere/shardingscaling/core/web/HttpServerHandlerTest.java
 ##
 @@ -66,31 +66,31 @@ public void setUp() {
 
 @Test
 public void channelReadStartFailed() {
-ByteBuf byteBuf = 
Unpooled.copiedBuffer(GSON.toJson(scalingConfiguration), CharsetUtil.UTF_8);
-fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, 
HttpMethod.POST, "/shardingscaling/job/start", byteBuf);
-httpServerHandler.channelRead0(channelHandlerContext, fullHttpRequest);
-ArgumentCaptor argumentCaptor = 
ArgumentCaptor.forClass(FullHttpResponse.class);
-verify(channelHandlerContext).writeAndFlush(argumentCaptor.capture());
-FullHttpResponse fullHttpResponse = (FullHttpResponse) 
argumentCaptor.getValue();
-
assertTrue(fullHttpResponse.content().toString(CharsetUtil.UTF_8).contains("Datasources
 check failed!"));
+//ByteBuf byteBuf = 
Unpooled.copiedBuffer(GSON.toJson(scalingConfiguration), CharsetUtil.UTF_8);
+//fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, 
HttpMethod.POST, "/shardingscaling/job/start", byteBuf);
+//httpServerHandler.channelRead0(channelHandlerContext, 
fullHttpRequest);
+//ArgumentCaptor argumentCaptor = 
ArgumentCaptor.forClass(FullHttpResponse.class);
+//
verify(channelHandlerContext).writeAndFlush(argumentCaptor.capture());
+//FullHttpResponse fullHttpResponse = (FullHttpResponse) 
argumentCaptor.getValue();
+//
assertTrue(fullHttpResponse.content().toString(CharsetUtil.UTF_8).contains("Datasources
 check failed!"));
 
 Review comment:
   Why comment unit test?
   If there are some reason have to ignore unit test, please use `@Ignore` 
annotation with description.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] software-market commented on issue #3854: ‘NullPointerException’ when getting database index

2020-01-07 Thread GitBox
software-market commented on issue #3854: ‘NullPointerException’ when getting 
database index
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3854#issuecomment-571893396
 
 
   This exception is thrown when hibernate is initialized . If I remove the 
‘update’ exception in the 
configuration, it will not appear. 
   @tristaZero 
   resultSet.getString(i)
   @KomachiSion 
   exception stack information.
   
   {INFO } [2020-01-08 13:03:25,986]  
: updating schema
   {ERROR} [2020-01-08 13:03:39,758]  
: could not complete schema update
   java.lang.NullPointerException
at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.DatabaseMetaDataResultSet.generateDatabaseMetaDataObject(DatabaseMetaDataResultSet.java:109)
at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.DatabaseMetaDataResultSet.initIterator(DatabaseMetaDataResultSet.java:90)
at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.DatabaseMetaDataResultSet.(DatabaseMetaDataResultSet.java:73)
at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.metadata.ResultSetReturnedDatabaseMetaData.getIndexInfo(ResultSetReturnedDatabaseMetaData.java:212)
at 
org.hibernate.tool.hbm2ddl.TableMetadata.initIndexes(TableMetadata.java:153)
at 
org.hibernate.tool.hbm2ddl.TableMetadata.(TableMetadata.java:58)
at 
org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:113)
at 
org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:981)
at 
org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:187)
at 
org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:346)
at 
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at 
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at 
org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at 
org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at 
org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at 
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at 
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at com.xxx.server.service.ServiceManager.start(ServiceManager.java:60)
at com.xxx.server.service.ServiceManager.(ServiceManager.java:52)
at 
com.weiguanai.server.service.ServiceManager.getInstance(ServiceManager.java:38)
at 
com.xxx.server.service.ServiceLocator.getTestService(ServiceLocator.java:87)
at com.xxx.server.test.Test.doPost(Test.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
a

[GitHub] [incubator-shardingsphere] KomachiSion commented on a change in pull request #3894: Use spi for datasources check

2020-01-07 Thread GitBox
KomachiSion commented on a change in pull request #3894: Use spi for 
datasources check
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3894#discussion_r364062781
 
 

 ##
 File path: 
sharding-scaling/sharding-scaling-core/src/main/java/org/apache/shardingsphere/shardingscaling/core/execute/executor/checker/AbstractChecker.java
 ##
 @@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.shardingscaling.core.execute.executor.checker;
+
+import com.zaxxer.hikari.HikariDataSource;
+import lombok.AccessLevel;
+import lombok.Getter;
+import 
org.apache.shardingsphere.shardingscaling.core.exception.DatasourceCheckFailedException;
+import org.apache.shardingsphere.shardingscaling.core.util.DataSourceFactory;
+
+import java.sql.SQLException;
+
+/**
+ * generic checker implement.
+ *
+ * @author ssxlulu
+ */
+public abstract class AbstractChecker implements Checker {
+
+@Getter(AccessLevel.PROTECTED)
+private final DataSourceFactory dataSourceFactory;
+
+public AbstractChecker(final DataSourceFactory dataSourceFactory) {
+this.dataSourceFactory = dataSourceFactory;
+}
+
+@Override
+public final void checkConnection() {
+try {
+for (HikariDataSource hikariDataSource : 
dataSourceFactory.getCachedDataSources().values()) {
+hikariDataSource.getConnection();
+}
 
 Review comment:
   Why not take the datasources as the input parameter, but get the datasource 
from the dataSourceFactory?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] beijing-penguin commented on issue #3681: tomcat start slowly with default datasource setting

2020-01-07 Thread GitBox
beijing-penguin commented on issue #3681:  tomcat start slowly with default 
datasource setting
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3681#issuecomment-571897402
 
 
   I think ShardingSphere should easy to expose loading interfaceso,The 
Users can customize the loading strategy


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] dongzl merged pull request #3887: Feature 3185 add nacos center

2020-01-07 Thread GitBox
dongzl merged pull request #3887: Feature 3185 add nacos center
URL: https://github.com/apache/incubator-shardingsphere/pull/3887
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] software-market edited a comment on issue #3854: ‘NullPointerException’ when getting database index

2020-01-07 Thread GitBox
software-market edited a comment on issue #3854: ‘NullPointerException’ when 
getting database index
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3854#issuecomment-571893396
 
 
   This exception is thrown when hibernate is initialized . If I remove the 
‘update’ exception in the 
configuration, it will not appear. 
   @tristaZero 
   resultSet.getString(i)
   @KomachiSion 
   exception stack information.
   
   ```
   {INFO } [2020-01-08 13:03:25,986]  
: updating schema
   {ERROR} [2020-01-08 13:03:39,758]  
: could not complete schema update
   java.lang.NullPointerException
at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.DatabaseMetaDataResultSet.generateDatabaseMetaDataObject(DatabaseMetaDataResultSet.java:109)
at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.DatabaseMetaDataResultSet.initIterator(DatabaseMetaDataResultSet.java:90)
at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.DatabaseMetaDataResultSet.(DatabaseMetaDataResultSet.java:73)
at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.metadata.ResultSetReturnedDatabaseMetaData.getIndexInfo(ResultSetReturnedDatabaseMetaData.java:212)
at 
org.hibernate.tool.hbm2ddl.TableMetadata.initIndexes(TableMetadata.java:153)
at 
org.hibernate.tool.hbm2ddl.TableMetadata.(TableMetadata.java:58)
at 
org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:113)
at 
org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:981)
at 
org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:187)
at 
org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:346)
at 
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at 
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at 
org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at 
org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at 
org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at 
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at 
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at com.xxx.server.service.ServiceManager.start(ServiceManager.java:60)
at com.xxx.server.service.ServiceManager.(ServiceManager.java:52)
at 
com.weiguanai.server.service.ServiceManager.getInstance(ServiceManager.java:38)
at 
com.xxx.server.service.ServiceLocator.getTestService(ServiceLocator.java:87)
at com.xxx.server.test.Test.doPost(Test.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3854: ‘NullPointerException’ when getting database index

2020-01-07 Thread GitBox
KomachiSion commented on issue #3854: ‘NullPointerException’ when getting 
database index
URL: 
https://github.com/apache/incubator-shardingsphere/issues/3854#issuecomment-571924172
 
 
   @software-market Sorry, I don't have SQLserver environment, can you use 
**original datasource** to print the result of `getIndexInfo`
   
   example code like 
   
   ```java
   DatabaseMetaData metaData = connection.getMetaData();
   ResultSet rs = metaData.getIndexInfo("xx", "", "xxx", false, false);
   ```


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] qiqsa opened a new issue #3896: ResultSet method not supported

2020-01-07 Thread GitBox
qiqsa opened a new issue #3896: ResultSet method not supported
URL: https://github.com/apache/incubator-shardingsphere/issues/3896
 
 
   ## Feature Request
   
   Druid 1.1.20 have support  this two method:
   public final  T getObject(final int columnIndex, final Class type) 
   public final  T getObject(final String columnLabel, final Class 
type) 
   
   but sharing not support this method 
   
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere-example] lidong1665 commented on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 integration reported the following error

2020-01-07 Thread GitBox
lidong1665 commented on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 
integration reported the following error
URL: 
https://github.com/apache/incubator-shardingsphere-example/issues/193#issuecomment-571930769
 
 
   4.0.0-RC3 and seata1.0.0 integration reported the following error
   
   ### Error updating database.  Cause: 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ### The error may exist in file 
[D:\springcloud\springboot-dubbo-seata-nacos\samples-storage\target\classes\mapper\TStorageMapper.xml]
   ### The error may involve 
io.seata.samples.integration.storage.mapper.TStorageMapper.decreaseStorage
   ### The error occurred while executing an update
   ### SQL: update t_storage set count = count-50 where commodity_code = ?
   ### Cause: java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ; ParameterMetaData; nested exception is 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   org.springframework.dao.InvalidDataAccessApiUsageException: 
   ### Error updating database.  Cause: 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ### The error may exist in file 
[D:\springcloud\springboot-dubbo-seata-nacos\samples-storage\target\classes\mapper\TStorageMapper.xml]
   ### The error may involve 
io.seata.samples.integration.storage.mapper.TStorageMapper.decreaseStorage
   ### The error occurred while executing an update
   ### SQL: update t_storage set count = count-50 where commodity_code = ?
   ### Cause: java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ; ParameterMetaData; nested exception is 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere-example] lidong1665 edited a comment on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 integration reported the following error

2020-01-07 Thread GitBox
lidong1665 edited a comment on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 
integration reported the following error
URL: 
https://github.com/apache/incubator-shardingsphere-example/issues/193#issuecomment-571930769
 
 
   **4.0.0-RC3 and seata1.0.0 integration reported the following error**
   
   ### Error updating database.  Cause: 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ### The error may exist in file 
[D:\springcloud\springboot-dubbo-seata-nacos\samples-storage\target\classes\mapper\TStorageMapper.xml]
   ### The error may involve 
io.seata.samples.integration.storage.mapper.TStorageMapper.decreaseStorage
   ### The error occurred while executing an update
   ### SQL: update t_storage set count = count-50 where commodity_code = ?
   ### Cause: java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ; ParameterMetaData; nested exception is 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   org.springframework.dao.InvalidDataAccessApiUsageException: 
   ### Error updating database.  Cause: 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ### The error may exist in file 
[D:\springcloud\springboot-dubbo-seata-nacos\samples-storage\target\classes\mapper\TStorageMapper.xml]
   ### The error may involve 
io.seata.samples.integration.storage.mapper.TStorageMapper.decreaseStorage
   ### The error occurred while executing an update
   ### SQL: update t_storage set count = count-50 where commodity_code = ?
   ### Cause: java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ; ParameterMetaData; nested exception is 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere-example] lidong1665 edited a comment on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 integration reported the following error

2020-01-07 Thread GitBox
lidong1665 edited a comment on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 
integration reported the following error
URL: 
https://github.com/apache/incubator-shardingsphere-example/issues/193#issuecomment-571930769
 
 
   **4.0.0-RC3 and seata1.0.0 integration reported the following error**
   
   `### Error updating database.  Cause: 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ### The error may exist in file 
[D:\springcloud\springboot-dubbo-seata-nacos\samples-storage\target\classes\mapper\TStorageMapper.xml]
   ### The error may involve 
io.seata.samples.integration.storage.mapper.TStorageMapper.decreaseStorage
   ### The error occurred while executing an update
   ### SQL: update t_storage set count = count-50 where commodity_code = ?
   ### Cause: java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ; ParameterMetaData; nested exception is 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   org.springframework.dao.InvalidDataAccessApiUsageException: 
   ### Error updating database.  Cause: 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ### The error may exist in file 
[D:\springcloud\springboot-dubbo-seata-nacos\samples-storage\target\classes\mapper\TStorageMapper.xml]
   ### The error may involve 
io.seata.samples.integration.storage.mapper.TStorageMapper.decreaseStorage
   ### The error occurred while executing an update
   ### SQL: update t_storage set count = count-50 where commodity_code = ?
   ### Cause: java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ; ParameterMetaData; nested exception is 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData 
   `


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere-example] lidong1665 edited a comment on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 integration reported the following error

2020-01-07 Thread GitBox
lidong1665 edited a comment on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 
integration reported the following error
URL: 
https://github.com/apache/incubator-shardingsphere-example/issues/193#issuecomment-571930769
 
 
   **4.0.0-RC3 and seata1.0.0 integration reported the following error**
   
   `
   ### Error updating database.  Cause: 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ### The error may exist in file 
[D:\springcloud\springboot-dubbo-seata-nacos\samples-storage\target\classes\mapper\TStorageMapper.xml]
   ### The error may involve 
io.seata.samples.integration.storage.mapper.TStorageMapper.decreaseStorage
   ### The error occurred while executing an update
   ### SQL: update t_storage set count = count-50 where commodity_code = ?
   ### Cause: java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ; ParameterMetaData; nested exception is 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   org.springframework.dao.InvalidDataAccessApiUsageException: 
   ### Error updating database.  Cause: 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ### The error may exist in file 
[D:\springcloud\springboot-dubbo-seata-nacos\samples-storage\target\classes\mapper\TStorageMapper.xml]
   ### The error may involve 
io.seata.samples.integration.storage.mapper.TStorageMapper.decreaseStorage
   ### The error occurred while executing an update
   ### SQL: update t_storage set count = count-50 where commodity_code = ?
   ### Cause: java.sql.SQLFeatureNotSupportedException: ParameterMetaData
   ; ParameterMetaData; nested exception is 
java.sql.SQLFeatureNotSupportedException: ParameterMetaData 
   `


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere-example] lidong1665 edited a comment on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 integration reported the following error

2020-01-07 Thread GitBox
lidong1665 edited a comment on issue #193: Sharding-jdbc4.0-RC2 and seata0.8.1 
integration reported the following error
URL: 
https://github.com/apache/incubator-shardingsphere-example/issues/193#issuecomment-571930769
 
 
   Sharding-jdbc4.0.0-RC3 and seata1.0.0  common error


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] sjssj opened a new issue #3897: document error

2020-01-07 Thread GitBox
sjssj opened a new issue #3897: document error
URL: https://github.com/apache/incubator-shardingsphere/issues/3897
 
 
   Hi,i found a error on the document 
@https://shardingsphere.apache.org/document/current/cn/manual/sharding-jdbc/configuration/config-spring-boot/#数据分片-数据脱敏
   When using sharding and encrypt function at the same time, the configuration 
should be
   **spring.shardingsphere.sharding.encrypt-rule**.xxx
   instead of
   **spring.shardingsphere.encrypt**.xxx


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services