Skip to content

Commit

Permalink
added fix for issue #33
Browse files Browse the repository at this point in the history
  • Loading branch information
corneversloot committed Mar 26, 2017
1 parent c3f1366 commit 25dd018
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Elastic announced the great news that they are workong on SQL support at Elastic{ON} 2017! You can find the talk on this topic on the [Elastic Website](https://www.elastic.co/elasticon/conf/2017/sf/elasticsearch-sql)

### sql4es: JDBC driver for Elasticsearch

Sql-for-Elasticsearch (sql4es) is a jdbc 4.1 driver for **Elasticsearch 2.0 - 2.4** implementing the majority of the JDBC interfaces: Connection, Statement, PreparedStatment, ResultSet, Batch and DataBase- / ResultSetMetadata. The screenshot below shows SQLWorkbenchJ with a selection of SQL statements that can be executed using the driver. As of version 0.8.2.3 the driver supports Shield allowing the use of credentials and SSL.
Expand Down
Binary file modified release/sql4es-0.9.2.4.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public boolean evaluate(List<Object> row) throws SQLException {
rightValue = this.rightValue.doubleValue();
}

if(this.comparisonType == Type.EQUAL) return leftValue == rightValue;
if(this.comparisonType == Type.EQUAL) return leftValue.equals( rightValue );
if(this.comparisonType == Type.GREATER_THAN) return leftValue > rightValue;
if(this.comparisonType == Type.GREATER_THAN_OR_EQUAL) return leftValue >= rightValue;
if(this.comparisonType == Type.LESS_THAN) return leftValue < rightValue;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/nl/anchormen/esjdbc/DatabaseMetadataIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public DatabaseMetadataIT() throws Exception {
public void testReadingProperties() throws Exception{
Driver driver = DriverManager.getDriver("jdbc:sql4es://localhost:9300/index");
DriverPropertyInfo[] info = driver.getPropertyInfo("jdbc:sql4es://localhost:9300/index", null);
assertEquals(8, info.length);
assertEquals(9, info.length);
for(DriverPropertyInfo i : info){
if(i.name.equals("query.timeout.ms")) assertEquals("10000", i.value);
}

info = driver.getPropertyInfo("jdbc:sql4es://localhost:9300/index?query.cache.table=tmp", null);
assertEquals(8, info.length);
assertEquals(9, info.length);
for(DriverPropertyInfo i : info){
if(i.name.equals("query.cache.table")) assertEquals("tmp", i.value);
}
Expand Down

0 comments on commit 25dd018

Please sign in to comment.