Skip to content

Commit 94f09e2

Browse files
author
hemiao
committed
moql-es moql-mongodb 独立模块
1 parent addcdb2 commit 94f09e2

File tree

13 files changed

+196
-15
lines changed

13 files changed

+196
-15
lines changed

moql-querier-es/pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.datayoo.moql</groupId>
7+
<artifactId>moql-parent</artifactId>
8+
<version>1.1.0</version>
9+
</parent>
10+
11+
<groupId>org.datayoo.footstone</groupId>
12+
<artifactId>moql-querier-es</artifactId>
13+
<packaging>jar</packaging>
14+
15+
<name>moql-querier-es</name>
16+
<url>http://maven.apache.org</url>
17+
18+
<properties>
19+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20+
</properties>
21+
22+
<dependencies>
23+
<dependency>
24+
<groupId>org.elasticsearch.client</groupId>
25+
<artifactId>elasticsearch-rest-high-level-client</artifactId>
26+
<version>7.9.2</version>
27+
</dependency>
28+
29+
<dependency>
30+
<groupId>org.datayoo.moql</groupId>
31+
<artifactId>moql-querier</artifactId>
32+
<version>1.2.1</version>
33+
<scope>compile</scope>
34+
</dependency>
35+
36+
<dependency>
37+
<groupId>junit</groupId>
38+
<artifactId>junit</artifactId>
39+
<version>4.13.1</version>
40+
<scope>test</scope>
41+
</dependency>
42+
</dependencies>
43+
</project>

moql-querier/src/main/java/org/datayoo/moql/querier/es/EsDataQuerier.java renamed to moql-querier-es/src/main/java/org/datayoo/moql/querier/es/EsDataQuerier.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
package org.datayoo.moql.querier.es;
22

3-
import com.google.gson.*;
43
import org.apache.commons.lang3.StringUtils;
54
import org.apache.commons.lang3.Validate;
65
import org.apache.http.HttpEntity;
76
import org.apache.http.HttpHost;
87
import org.apache.http.entity.ContentType;
98
import org.apache.http.nio.entity.NStringEntity;
109
import org.apache.http.util.EntityUtils;
11-
import org.datayoo.moql.*;
1210
import org.datayoo.moql.core.RecordSetImpl;
13-
import org.datayoo.moql.metadata.*;
1411
import org.datayoo.moql.operand.OperandContextArrayList;
1512
import org.datayoo.moql.operand.OperandFactory;
1613
import org.datayoo.moql.operand.factory.OperandFactoryImpl;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.datayoo.footstone;
2+
3+
import junit.framework.Test;
4+
import junit.framework.TestCase;
5+
import junit.framework.TestSuite;
6+
7+
/**
8+
* Unit test for simple App.
9+
*/
10+
public class AppTest
11+
extends TestCase
12+
{
13+
/**
14+
* Create the test case
15+
*
16+
* @param testName name of the test case
17+
*/
18+
public AppTest( String testName )
19+
{
20+
super( testName );
21+
}
22+
23+
/**
24+
* @return the suite of tests being tested
25+
*/
26+
public static Test suite()
27+
{
28+
return new TestSuite( AppTest.class );
29+
}
30+
31+
/**
32+
* Rigourous Test :-)
33+
*/
34+
public void testApp()
35+
{
36+
assertTrue( true );
37+
}
38+
}

moql-querier-milvus/src/test/java/org/datayoo/moql/querier/milvus/MilvusQuerierTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,24 @@
1414
public class MilvusQuerierTest extends TestCase {
1515

1616
public void testBuildQueryParam() {
17+
1718
MilvusQuerier milvusQuerier = new MilvusQuerier();
1819
String sql = "select col1, col2 from t where col3 = 4 and vMatch(vec, 'L2', '[[1.0, 2.0, 3.0],[1.1,2.1,3.1]]') and col4 in ('a', 'b', 'c') and consistencyLevel('STRONG') and nProbe(10) limit 10,5";
1920
try {
2021
SearchParam searchParam = milvusQuerier.buildSearchParam(sql);
22+
System.out.println(searchParam);
23+
} catch (IOException e) {
24+
throw new RuntimeException(e);
25+
}
26+
}
27+
28+
public void testBuildQueryParam2() {
29+
MilvusQuerier milvusQuerier = new MilvusQuerier();
30+
String sql = "select ip.src from " +
31+
"ip3 ip group by ip.src";
32+
try {
33+
SearchParam searchParam = milvusQuerier.buildSearchParam(sql);
34+
System.out.println(searchParam);
2135
} catch (IOException e) {
2236
throw new RuntimeException(e);
2337
}

moql-querier-mongodb/pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.datayoo.moql</groupId>
7+
<artifactId>moql-parent</artifactId>
8+
<version>1.1.0</version>
9+
</parent>
10+
11+
<groupId>org.datayoo.footstone</groupId>
12+
<artifactId>moql-querier-mongodb</artifactId>
13+
<packaging>jar</packaging>
14+
15+
<name>moql-querier-mongodb</name>
16+
<url>http://maven.apache.org</url>
17+
18+
<properties>
19+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20+
</properties>
21+
22+
<dependencies>
23+
<dependency>
24+
<groupId>junit</groupId>
25+
<artifactId>junit</artifactId>
26+
<version>3.8.1</version>
27+
<scope>test</scope>
28+
</dependency>
29+
30+
<dependency>
31+
<groupId>org.datayoo.moql</groupId>
32+
<artifactId>moql-querier</artifactId>
33+
<version>1.2.1</version>
34+
<scope>compile</scope>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>org.mongodb</groupId>
39+
<artifactId>mongodb-driver-sync</artifactId>
40+
<version>4.2.3</version>
41+
</dependency>
42+
</dependencies>
43+
</project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.datayoo.footstone;
2+
3+
import junit.framework.Test;
4+
import junit.framework.TestCase;
5+
import junit.framework.TestSuite;
6+
7+
/**
8+
* Unit test for simple App.
9+
*/
10+
public class AppTest
11+
extends TestCase
12+
{
13+
/**
14+
* Create the test case
15+
*
16+
* @param testName name of the test case
17+
*/
18+
public AppTest( String testName )
19+
{
20+
super( testName );
21+
}
22+
23+
/**
24+
* @return the suite of tests being tested
25+
*/
26+
public static Test suite()
27+
{
28+
return new TestSuite( AppTest.class );
29+
}
30+
31+
/**
32+
* Rigourous Test :-)
33+
*/
34+
public void testApp()
35+
{
36+
assertTrue( true );
37+
}
38+
}

moql-querier/pom.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,7 @@
4141
<artifactId>moql-translator</artifactId>
4242
<version>RELEASE</version>
4343
</dependency>
44-
<dependency>
45-
<groupId>org.mongodb</groupId>
46-
<artifactId>mongodb-driver-sync</artifactId>
47-
<version>4.2.3</version>
48-
</dependency>
49-
<dependency>
50-
<groupId>org.elasticsearch.client</groupId>
51-
<artifactId>elasticsearch-rest-high-level-client</artifactId>
52-
<version>7.9.2</version>
53-
</dependency>
44+
5445
</dependencies>
5546

5647
<build>

0 commit comments

Comments
 (0)