Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d51a681

Browse files
author
石源
committed
fix NLPchina#653 复杂运算查询会报错
1 parent 640a5fa commit d51a681

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.nlpcn</groupId>
55
<artifactId>elasticsearch-sql</artifactId>
6-
<version>6.2.4.0</version>
6+
<version>6.2.4.1</version>
77
<packaging>jar</packaging>
88
<description>Query elasticsearch using SQL</description>
99
<name>elasticsearch-sql</name>

src/main/java/org/nlpcn/es4sql/SQLFunctions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private static String extractName(SQLExpr script) {
221221
String newScript = variance[variance.length - 1];
222222
if (newScript.trim().startsWith("def ")) {
223223
//for now ,if variant is string,then change to double.
224-
return newScript.substring(4).split("=")[0].trim();
224+
return newScript.trim().substring(4).split("=")[0].trim();
225225
} else return scriptStr;
226226
}
227227

@@ -232,7 +232,7 @@ private static String convertType(SQLExpr script) {
232232
String newScript = variance[variance.length - 1];
233233
if (newScript.trim().startsWith("def ")) {
234234
//for now ,if variant is string,then change to double.
235-
String temp = newScript.substring(4).split("=")[0].trim();
235+
String temp = newScript.trim().substring(4).split("=")[0].trim();
236236

237237
return " if( " + temp + " instanceof String) " + temp + "= Double.parseDouble(" + temp.trim() + "); ";
238238
} else return "";

0 commit comments

Comments
 (0)