Skip to content

Commit 83f4b17

Browse files
authored
Merge pull request #19 from SOFTNETWORK-APP/refactoring
add support for : - RLIKE - CONVERT, TRY_CAST, SAFE_CAST functions - CAST OPERATOR (::) - OFFSET with LIMIT - TOP HITS aggregations (FIRST_VALUE / FIRST, LAST_VALUE / LAST) - GROUP BY with field index - TODAY - LAST_DAY / LAST - WEEK_OF_YEAR / WEEK - DAY_OF_WEEK / WEEKDAY - DAY_OF_YEAR / YEARDAY - NANO_OF_SECOND / NANOSECOND - MICRO_OF_SECOND / MICROSECOND - MILLI_OF_SECOND / MILLISECOND - EPOCH_DAY / EPOCHDAY - OFFSET_SECONDS / OFFSET - QUARTER_OF_YEAR / QUARTER - ARRAY_AGG aggregation - LTRIM, RTRIM, LEFT, RIGHT, REPLACE, REVERSE, POSITION and REGEXP_LIKE string functions - Temporal and geo distance BETWEEN - temporal parsing and formatting using MySQL-style date time formats
2 parents 5193c94 + 450307c commit 83f4b17

File tree

106 files changed

+9510
-3783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+9510
-3783
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This project provides a trait-based interface (`ElasticClientApi`) that aggregat
2020
By relying on these concrete implementations, developers can switch between versions with minimal changes to their business logic.
2121

2222
**SQL to Elasticsearch Query Translation**
23-
Elastic Client includes a parser capable of translating SQL `SELECT` queries into Elasticsearch queries. The parser produces an intermediate representation, which is then converted into [Elastic4s](https://github.com/sksamuel/elastic4s) DSL queries and ultimately into native Elasticsearch queries. This allows data engineers and analysts to express queries in familiar SQL syntax.
23+
Elastic Client includes a parser capable of translating SQL `SELECT` queries into Elasticsearch queries. The parser produces an intermediate representation, which is then converted into [Elastic4s](https://github.com/sksamuel/elastic4s) DSL queries and ultimately into native Elasticsearch queries. This allows data engineers and analysts to express queries in familiar [SQL](documentation/README.md) syntax.
2424

2525
**Dynamic Mapping Migration**
2626
Elastic Client provides tools to analyze and compare existing mappings with new ones. If differences are detected, it can automatically perform safe migrations. This includes creating temporary indices, reindexing, and renaming — all while preserving data integrity. This eliminates the need for manual mapping migrations and reduces downtime.

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ThisBuild / organization := "app.softnetwork"
1919

2020
name := "softclient4es"
2121

22-
ThisBuild / version := "0.8.0"
22+
ThisBuild / version := "0.9.0"
2323

2424
ThisBuild / scalaVersion := scala213
2525

core/src/main/scala/app/softnetwork/elastic/client/AggregateResult.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package app.softnetwork.elastic.client
22

3-
import app.softnetwork.elastic.sql.AggregateFunction
3+
import app.softnetwork.elastic.sql.function.aggregate.AggregateFunction
44

55
sealed trait AggregateResult {
66
def field: String

core/src/main/scala/app/softnetwork/elastic/client/ElasticClientApi.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import _root_.akka.stream.{FlowShape, Materializer}
88
import akka.stream.scaladsl._
99
import app.softnetwork.persistence.model.Timestamped
1010
import app.softnetwork.serialization._
11-
import app.softnetwork.elastic.sql.{SQLQuery, SQLSearchRequest}
11+
import app.softnetwork.elastic.sql.query.{SQLQuery, SQLSearchRequest}
1212
import com.google.gson.JsonParser
1313
import com.typesafe.config.{Config, ConfigFactory}
1414
import org.json4s.{DefaultFormats, Formats}

core/src/main/scala/app/softnetwork/elastic/client/MappingComparator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package app.softnetwork.elastic.client
33
import com.google.gson._
44
import com.typesafe.scalalogging.StrictLogging
55

6-
import scala.collection.JavaConverters._
6+
import scala.jdk.CollectionConverters._
77
import scala.util.{Failure, Success, Try}
88

99
object MappingComparator extends StrictLogging {

core/src/main/scala/app/softnetwork/elastic/client/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import scala.collection.mutable
1313
import scala.language.reflectiveCalls
1414
import scala.util.{Failure, Success, Try}
1515

16-
import scala.collection.JavaConverters._
16+
import scala.jdk.CollectionConverters._
1717

1818
/** Created by smanciot on 30/06/2018.
1919
*/

core/src/main/scala/app/softnetwork/elastic/persistence/query/ElasticProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package app.softnetwork.elastic.persistence.query
22

33
import app.softnetwork.elastic.client.ElasticClientApi
4-
import app.softnetwork.elastic.sql.SQLQuery
4+
import app.softnetwork.elastic.sql.query.SQLQuery
55
import mustache.Mustache
66
import org.json4s.Formats
77
import app.softnetwork.persistence._

core/testkit/src/main/scala/app/softnetwork/elastic/client/ElasticClientSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import akka.actor.ActorSystem
44
import app.softnetwork.elastic.model.{Binary, Child, Parent, Sample}
55
import app.softnetwork.elastic.persistence.query.ElasticProvider
66
import app.softnetwork.elastic.scalatest.ElasticDockerTestKit
7-
import app.softnetwork.elastic.sql.SQLQuery
7+
import app.softnetwork.elastic.sql.query.SQLQuery
88
import app.softnetwork.persistence._
99
import app.softnetwork.persistence.person.model.Person
1010
import com.fasterxml.jackson.core.JsonParseException

core/testkit/src/main/scala/app/softnetwork/elastic/client/MockElasticClientApi.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package app.softnetwork.elastic.client
33
import akka.NotUsed
44
import akka.actor.ActorSystem
55
import akka.stream.scaladsl.Flow
6-
import app.softnetwork.elastic.sql.{SQLQuery, SQLSearchRequest}
6+
import app.softnetwork.elastic.sql.query.{SQLQuery, SQLSearchRequest}
77
import org.json4s.Formats
88
import app.softnetwork.persistence.model.Timestamped
99
import org.slf4j.{Logger, LoggerFactory}

documentation/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SQL Engine Documentation
2+
3+
Welcome to the SQL Engine Documentation. Navigate through the sections below:
4+
5+
- [Query Structure](request_structure.md)
6+
- [Operators](operators.md)
7+
- [Operator Precedence](operator_precedence.md)
8+
- [Aggregate Functions](functions_aggregate.md)
9+
- [Date/Time Functions](functions_date_time.md)
10+
- [Math Functions](functions_math.md)
11+
- [String Functions](functions_string.md)
12+
- [Type Conversion](type_conversion.md)
13+
- [Conditional Functions](functions_conditional.md)
14+
- [Geo Functions](functions_geo.md)
15+
- [Keywords](keywords.md)

0 commit comments

Comments
 (0)