SPLWare / esProc

esProc SPL is a scripting language for data processing, with well-designed rich library functions and powerful syntax, which can be executed in a Java program through JDBC interface and computing independently.
http://doc.scudata.com/esproc/
Apache License 2.0
4.57k stars 329 forks source link

并发问题 #5

Open onekilogram opened 2 years ago

onekilogram commented 2 years ago

select 字段1 + '#'+字段2 from table_1

我要表达的意思是不支持并发,根本原因是 ExpressionTranslator这个类的 marksList与funcsList 是static对象,这边能优化这个地方么?

java.sql.SQLException: String index out of range: -1 at com.esproc.jdbc.InternalStatement.executeJDBC(InternalStatement.java:286) at com.esproc.jdbc.InternalStatement$1.run(InternalStatement.java:148) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.AbstractStringBuilder.replace(AbstractStringBuilder.java:851) at java.lang.StringBuffer.replace(StringBuffer.java:452) at com.scudata.dm.query.utils.ExpressionTranslator.moveInMarks(ExpressionTranslator.java:257) at com.scudata.dm.query.utils.ExpressionTranslator.translateExp(ExpressionTranslator.java:115) at com.scudata.dm.query.SimpleSelect.execute(SimpleSelect.java:6298) at com.scudata.dm.query.SimpleSelect.query(SimpleSelect.java:3007) at com.scudata.dm.query.SimpleJoin.query(SimpleJoin.java:5129) at com.scudata.dm.query.SimpleUnion.query(SimpleUnion.java:84) at com.scudata.dm.query.SimpleSQL.execute(SimpleSQL.java:140) at com.scudata.app.common.AppUtil.executeSql(AppUtil.java:198) at com.esproc.jdbc.JDBCUtil.execute(JDBCUtil.java:398) at com.esproc.jdbc.InternalStatement.executeJDBC(InternalStatement.java:267) ... 1 common frames omitted

xjl002 commented 2 years ago

我们不打算把这个“简单SQL”支持到很完善的地步。建议直接去用SPL代码,derive函数能产生新的计算列: T(...).derive(...)

单句SPL一样可以用JDBC调用,和SQL一样简单。