Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Groovy to support using Lambda in row expressions #15277

Closed
linghengqian opened this issue Feb 7, 2022 · 5 comments · Fixed by #15303
Closed

Upgrade Groovy to support using Lambda in row expressions #15277

linghengqian opened this issue Feb 7, 2022 · 5 comments · Fixed by #15303
Milestone

Comments

@linghengqian
Copy link
Member

linghengqian commented Feb 7, 2022

Feature Request

For English only, other languages will not accept.

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot make decision by current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Is your feature request related to a problem?

Maybe related to #13240 .

Describe the feature you would like.

I would like to upgrade the version of org.codehaus.groovy:groovy to 3.0.9 or higher to support in actual-data-nodes or algorithm-expression in the usage scenario of the equal-line expression, the Lambda syntax of Java 8 is used. As stated in http://groovy-lang.org/releasenotes/groovy-3.0.html , after groovy 3, use stream() Functional writing provides support.

In the current version of ShardingSphere( 5.1.0 ), it is not easy to customize actualDataNodes. Taking time slicing as an example, you may write something like ds$->{0..1}.t_order_$->{2021..2022}${(1..12).collect{t ->t.toString().padLeft(2,'0')} } sentence, if you build some tables by day, you must use JAVA API dealing with things like leap years, and in non-Java environments, the process of configuring the ShardingSphere Proxy is not straightforward. I believe the Groovy version that supports Lambda simplifies the process.

An additional consideration is that org.apache.groovy:groovy:4.0.0 has improved support for JPMS ( as stated in http://groovy-lang.org/releasenotes/groovy-4.0.html ), which helps to deal with the issues in #13080 mentioned issues. But currently Groovy 4.0.0 does not support Grails (introduced in grails/grails-core#12373), skipping Groovy 3.x may cause additional impact.

@linghengqian
Copy link
Member Author

I'm not sure if ShardingSphere has a child component that uses Java 7, and if it does, it clearly shouldn't be upgraded to Groovy V3.

@terrymanu
Copy link
Member

ShardingSphere just for jdk 1.8 and above

@terrymanu
Copy link
Member

maybe we can try to upgrade groovy version,this is so cool

@linghengqian
Copy link
Member Author

I submitted a PR to deal with this issue, not sure if it will affect some untested components of a series of projects in ShardingSphere Example, maybe I'll have to wait for more responses.

@terrymanu terrymanu added this to the 5.1.1 milestone Feb 19, 2022
@terrymanu terrymanu modified the milestones: 5.1.1, 5.1.0 Feb 19, 2022
@linghengqian
Copy link
Member Author

Only provide tips for some friends who need them. SpringBoot will increase Groovy to 4.0.0 in 3.x, and 2.x will not be changed. Refer to spring-projects/spring-boot#30278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants