Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
323 commits
Select commit Hold shift + click to select a range
c87b5be
Add basic support for routed PolyPlans
tobias-weber May 28, 2024
2bdde1a
Add different severity levels for Metadata Badges
tobias-weber May 29, 2024
bd29234
Do not generate logical query plan for already routed plans
tobias-weber May 30, 2024
7fdcef3
Change EntityArg to use the adapterName
tobias-weber May 30, 2024
63b6172
Add print statements to debug failed test
tobias-weber May 30, 2024
4b9320d
Remove print statements to debug failed test
tobias-weber May 30, 2024
42b3e14
Bug fixes
tobias-weber May 30, 2024
009d4e7
Change InformationPage labels to group them by statement
tobias-weber May 31, 2024
52e7ea7
Add common PolyAlg Operators
tobias-weber Jun 3, 2024
de4d35f
Add partial support for Transformer operators
tobias-weber Jun 4, 2024
1777285
Adjustments to LogicalTransformer
tobias-weber Jun 6, 2024
1ad889f
Add partitionName in serialization
tobias-weber Jun 6, 2024
43469e5
Introduce some Enumerable AlgNodes
tobias-weber Jun 7, 2024
a808d76
Add more physical operators
tobias-weber Jun 7, 2024
fba8cc8
Add even more physical operators
tobias-weber Jun 10, 2024
fc4f226
Add EnumerableTransformer to PolyAlg
tobias-weber Jun 10, 2024
5644350
Add JdbcScan to PolyAlg
tobias-weber Jun 11, 2024
ef5b343
Add LogicalDocumentValues
tobias-weber Jun 11, 2024
526c14c
Improve doc and lpg PolyAlgebra support
tobias-weber Jun 12, 2024
6be7583
Handle duplicate names in the OperatorRegistry
tobias-weber Jun 13, 2024
4a820eb
Enable execution of physical PolyPlans
tobias-weber Jun 14, 2024
59c4e91
Derive type for LpgAggregate
tobias-weber Jun 14, 2024
2617934
Multiple new AlgNodes registered and various bugfixes
tobias-weber Jun 17, 2024
c7f4607
Disable auxiliary projects for physical plans
tobias-weber Jun 17, 2024
059b114
More physical nodes, bugfixes and tests
tobias-weber Jun 18, 2024
9b54a13
added option to create complex return type interfering for LangFuncti…
datomo Jun 20, 2024
7939f5c
Correctly infer type with CYPHER_PATH_MATCH
tobias-weber Jun 20, 2024
d1ab173
Add cypherExtractFromPathTest
tobias-weber Jun 20, 2024
bcc1ae5
Add ability to view LogicalWindow operators
tobias-weber Jun 20, 2024
6fa4b1c
Add doc and graph specific tests
tobias-weber Jun 21, 2024
2480922
Rename collectAttributes to bindArguments and add comments
tobias-weber Jun 27, 2024
3ff5c5c
Cleanup of various PolyAlg related code
tobias-weber Jul 12, 2024
61b99fb
Remove InformationQueryPlan
tobias-weber Jul 12, 2024
6875260
Remove AlgRequest
tobias-weber Jul 12, 2024
9cbcbc9
Change name of "sort" parameter to "order"
tobias-weber Jul 16, 2024
7ec14a7
Remove the QueryPlanBuilder and AlgProcessor
tobias-weber Jul 16, 2024
1a8f3c0
Register MQL Query Operators in MongoLanguagePlugin
murermader Aug 15, 2024
5829826
Finish implementation for docGeoIntersects and convertInputToPolyGeom…
murermader Aug 20, 2024
f586bce
docGeoIntersects + Started adding logic to convert PolyValues into Po…
murermader Aug 19, 2024
3d85c19
Add missing break statements in translateDocument
murermader Aug 20, 2024
1780009
cleanup convertGeoIntersects
murermader Aug 20, 2024
06ea979
Added support for $geoWithin
murermader Aug 20, 2024
725bf9d
Parse $box in convertGeoWithin
murermader Aug 20, 2024
873ef11
Parse $polygon in convertGeoWithin
murermader Aug 21, 2024
f38ff07
Parse $center in convertGeoWithin
murermader Aug 21, 2024
11fb7c8
Parse $centerSphere in convertGeoWithin
murermader Aug 21, 2024
c6b0bac
Fixed behavior of docGeoWithin, when a Point lies on the edge of anot…
murermader Aug 21, 2024
fcd6158
Added unit test docGeoWithinTest
murermader Aug 21, 2024
bc9d006
Small refactoring
murermader Aug 21, 2024
0ac0213
Pass PolyGeometry directly to docGeoIntersects and docGeoWithin
murermader Aug 22, 2024
f62a83d
Give a clear error message, if the user tries to use legacy coordinat…
murermader Aug 22, 2024
cf7faa0
Use MongoDB and HSQLDB in MqlGeoFunctionsTest (WIP)
murermader Aug 23, 2024
29ac567
Add MongoDB adapter in MqlGeoFunctionsTest
murermader Aug 23, 2024
9f6ed96
Add translateGeoWithin to MongFilter for $geometry
murermader Aug 23, 2024
0f73eac
Fixed bug in docGeoWithin where we tried to create the PolyGeometry f…
murermader Aug 23, 2024
8ecea7f
Extended docGeoWithinTest to test operand $geometry
murermader Aug 23, 2024
dce3e2a
geoWithin translate $centerSphere + convert radians to meters before …
murermader Aug 23, 2024
7db722d
Add test for $geoWithin with $centerSphere
murermader Aug 23, 2024
690d7c3
Add support for $center, $box and $polygon in translateGeoWithin
murermader Aug 23, 2024
04678de
Add translateGeoIntersects() + test
murermader Aug 23, 2024
694ecfe
Hack so that I do not get a InvalidGeometryException in the generated…
murermader Aug 25, 2024
ec5721a
TestHelper: Disable timeout for HttpConnection
murermader Aug 25, 2024
0f203b1
docGeoIntersectsTest now uses both hsqldb and mongodb to check the re…
murermader Aug 25, 2024
337924e
Add method to compare DocResult from mongo and polypheny
murermader Aug 27, 2024
d50f158
It is possible to run the query on mongo and internally by adding / r…
murermader Aug 27, 2024
1374325
Changes from meeting
murermader Aug 28, 2024
87d612e
docGeoIntersectsTest: Try to add remove placements, to run query on s…
murermader Aug 28, 2024
74c4ea9
added correct syntax to specific store during collection deployment
datomo Aug 29, 2024
f1abae5
Add helper methods and cleanup test setup
murermader Aug 29, 2024
ab82c7e
Convert input geometry into the correct CRS, if the SRIDs don't match.
murermader Aug 29, 2024
fae2920
Add MQL_GEO_DISTANCE function + Add LogicalDocumentProject step for $…
murermader Sep 3, 2024
47eb5ca
Add support for legacy coordinates to $near
murermader Sep 4, 2024
92df55c
Add adds to DocumentProject, to add fields without removing unrelated…
murermader Sep 5, 2024
a8ceced
Disable CalcMergeRule in the document model, because of issues with c…
murermader Sep 5, 2024
3bba010
Add DocumentNearUnwrap rule to convert $near into multiple operators
murermader Sep 5, 2024
ed14cdb
Changes to docNearTest
murermader Sep 5, 2024
cadead9
$near: Add sort + unset
murermader Sep 7, 2024
1e1b457
Create PolyGeometry using ofOrThrow during code-generation
murermader Sep 8, 2024
e68aae6
added workaround to serve webapp from local directory, by placing web…
datomo Sep 8, 2024
dee33c2
Add support for $nearSphere, remove convertDistance from translatePro…
murermader Sep 9, 2024
5e645a3
Add support for $geoNear aggregation stage.
murermader Sep 9, 2024
cb3949f
mergeDocumentAdd now can also add names with a . as nested documents
murermader Sep 9, 2024
cac624e
Create $near RexCall in MqlToAlgConverter + Add ConverterRule to unwr…
murermader Sep 10, 2024
9964fe8
Removed methods docNear and docNearSphere to see what happens
murermader Sep 10, 2024
689a36a
DocumentNearUnwrap: Return replacementNode directly instead of creati…
murermader Sep 10, 2024
f628057
Disable DocumentProjectToCalcRule and DocumentFilterToCalcRule with N…
murermader Sep 13, 2024
4948d9d
Add translation for $near and $nearSphere operator
murermader Oct 2, 2024
9639622
Add operator for Cypher point() function (WIP)
murermader Oct 3, 2024
79105e8
Add MqlCreateIndex
murermader Oct 4, 2024
c786a08
Do not call createIndex in test setup (should be done automatically o…
murermader Oct 4, 2024
3c3e20d
MqlCreateIndex now throws UnsupportedOperationException
murermader Oct 4, 2024
8e14a7d
Translate MQL_NEAR to $geoNear instead of $match when converting quer…
murermader Oct 5, 2024
7fcb05e
Add Cypher point() function
murermader Oct 8, 2024
e900aaf
Add docsNearTestOnlMongoDb test
murermader Oct 8, 2024
eabcb91
Add CypherGeoFunctionsTest
murermader Oct 8, 2024
ff9e770
Continue work on CYPHER_POINT
murermader Oct 8, 2024
fa9bdbd
Add logic for converting map to point
murermader Oct 8, 2024
dd5463e
Add CYPHER_DISTANCE function
murermader Oct 8, 2024
f32489d
CYPHER_POINT null handling + set SRID if crs or srid is present in map
murermader Oct 8, 2024
50db081
Add CYPHER_WITHIN_BBOX
murermader Oct 8, 2024
e1a11db
Throw exception if someone tries to return the value of a function wi…
murermader Oct 11, 2024
91e1052
Convert point arguments to PolyMap to pass to create the RexCall
murermader Oct 11, 2024
233fc2a
Create index when offloading geospatial query that requires index (TODO)
murermader Oct 11, 2024
cfb33ef
Update RexBuilder.clean method to handle MAP and ANY type
murermader Oct 11, 2024
629d4ff
Fix RexBuilder.makeMap + refactor code in CypherReturnItem
murermader Oct 11, 2024
49f1df2
Refactor CypherFunctions.convertPolyValueToDouble to handle BigDecima…
murermader Oct 11, 2024
dd768a8
CypherTestTemplate.point(): Verify that SRID and coordinates are set …
murermader Oct 14, 2024
cffe4c4
Fix RexCall for point() if return value is assigned to a variable
murermader Oct 14, 2024
901c421
Reuse OperatorName.DISTANCE for Cypher distance(p1, p2) implementation
murermader Oct 14, 2024
9d379b0
Add test where point() is called with variables instead of values
murermader Oct 14, 2024
fb43015
Do not throw exception in MongoFilter.translateNear
murermader Oct 15, 2024
5f0deb8
MongoFilter.translateGeoNear: Write and read values from indexAndInde…
murermader Oct 15, 2024
0a80f7c
docsNearTestOnlMongoDb Add test data
murermader Oct 15, 2024
75e0426
Add commented code that needs to be ported to DocumentNearUnwrap
murermader Oct 15, 2024
6b5db16
DocumentNearUnwrap: Finish implementation (filter, sort, unset) + rem…
murermader Oct 15, 2024
fa36416
CypherFunctions.point() replaced map argument with 10 arguments for a…
murermader Oct 20, 2024
189207a
Add support for calling CypherFunctions.distance
murermader Oct 20, 2024
5028f07
PolyGeometry.toWKT() now supports the Z dimensions for Points
murermader Oct 20, 2024
ee28cd6
Use Z coordinate for euclidean distance calculation in CypherFunction…
murermader Oct 20, 2024
b410a63
Use same logic as Neo4j to calculate distances with 3 dimensions
murermader Oct 20, 2024
74590b6
Implement Cypher.withinBBox, move getRex to CypherFunctionInvocation,…
murermader Oct 22, 2024
f26e8b2
Add more tests for CypherFunctions.withinBBox() and correct handling …
murermader Oct 22, 2024
8263515
Remove commented out code in withinBBoxTest()
murermader Oct 22, 2024
907dfaf
Throw better error if field selected in query is empty + Add test for…
murermader Nov 4, 2024
59ea163
fixed merge conflicts
datomo Nov 7, 2024
d28c3ab
Merge branch 'master' of https://github.com/polypheny/Polypheny-DB in…
datomo Dec 3, 2024
ade00e2
re-added missing translated logic to languageManager, fixed extract f…
datomo Dec 3, 2024
573af18
adjusted missing prepareQuery parameters
datomo Dec 3, 2024
e54d351
increased test timeout
datomo Dec 3, 2024
67650ef
fixed missing transaction handling in tests
datomo Dec 3, 2024
3bab892
fixed incorrect collection and db creation
datomo Dec 3, 2024
46d7f0a
Add canAssign from CHAR and VARCHAR to PolyGeometry
murermader Dec 7, 2024
81b4b4b
initial changes to deal with CyclicMetadataException
datomo Dec 9, 2024
e6154a9
adjustment to make rowCount calculation more robust and hopefully fix…
datomo Dec 9, 2024
710e639
added pessimistic handling of CyclicMetadataException
datomo Dec 9, 2024
2be6caa
added executor pool for concurrently setting the poly algebra, and ad…
datomo Dec 10, 2024
e3c7690
checking if increased wait for physical serializing fixes null error …
datomo Dec 10, 2024
855de30
added better tracking of concurrent alg serialization
datomo Dec 10, 2024
4d9f16f
minor adjustment for logging errors
datomo Dec 10, 2024
aa7e405
added handling for ui attaching
datomo Dec 11, 2024
4e1f61b
small adjustment to handle potential null value on rowcount
datomo Dec 11, 2024
6238f74
added some exceptions for textual alg representation
datomo Dec 11, 2024
a8844a0
adjusted adding of physical plan
datomo Dec 11, 2024
4d33a73
removed separate threading for debugging purposes
datomo Dec 11, 2024
0fc9e93
added some catching in tests to not block transactions
datomo Dec 11, 2024
556a47e
re-adding concurrent logic for physical plans
datomo Dec 12, 2024
879803f
Merge branch 'algebra-exploration' into multimodel-gis2
murermader Dec 13, 2024
8f12d94
RexLiteral: Add missing implementation for PolyGeometry type
murermader Dec 14, 2024
4f7430a
Changes to merge to make the project build again + Add missing Cypher…
murermader Dec 14, 2024
97ccc6f
User Testing: Disallow DML queries if RO file exists in user home dir…
murermader Dec 15, 2024
a5c6308
PolyGeometry: Implicitly convert VARCAHR to PolyGeometry inside asGeo…
murermader Dec 17, 2024
778912e
CypherGeoFunctionsTest: Add test that checks whether nodes that creat…
murermader Dec 17, 2024
8745615
log.warn
murermader Dec 18, 2024
264c89d
log.warn
murermader Dec 18, 2024
de65986
log.warn
murermader Dec 18, 2024
58b02b6
log.warn
murermader Dec 18, 2024
34b2fb7
log.warn
murermader Dec 18, 2024
cc245ac
Make it possible to insert test data
murermader Dec 18, 2024
cea723f
SQL: Allow the usage of the word TEMPERATURE in variables
murermader Dec 18, 2024
8b87dba
Add the OperatorName.MQL_MERGE_ADD back in (Was accidentally removed …
murermader Dec 18, 2024
388a4f7
Convert OperatorName.CYPHER_POINT function call to Point in Cypher
murermader Dec 18, 2024
a36eab0
log.warn
murermader Dec 18, 2024
3210ca7
fixed cross model queries, which do not use same models
datomo Dec 20, 2024
ab5018e
Merge branch 'multimodel-gis2' of github.com:polypheny/Polypheny-DB i…
datomo Dec 20, 2024
72dbe0e
MQL docGeoWithin: Implicitly convert string into geometry
murermader Dec 25, 2024
1f85b7a
Mql: Handle case where input is already PolyGeometry
murermader Dec 25, 2024
3da583f
GIS: Store PolyDictionary as JSON instead of String, so that we can p…
murermader Jan 2, 2025
42aaa95
GIS: Create Neo4j adater in Cypher tests + create graph on neo4j data…
murermader Jan 7, 2025
2e5e22f
Restore graph from Neo4j to graph model instead of relational model
murermader Jan 13, 2025
4f27e68
GIS: Remove check for RO file when running DDL queries
murermader Jan 13, 2025
c1bbeeb
Skip arguments for CYPHER_POINT when traslating query to Cypher
murermader Jan 13, 2025
7164ba7
NeoUtil: Handle conversion of point function to and from Neo4j
murermader Jan 13, 2025
594bd40
createPointTest: Add comment
murermader Jan 13, 2025
9668261
createPointTest: Add comment
murermader Jan 13, 2025
68ffca6
CypherLiteral.convertMapToPolyGeometry
murermader Jan 13, 2025
6c8f0ef
NeoStatements now supports point syntax
murermader Jan 13, 2025
c3e85a5
NeoUtil.asPolyValue now also supports PolyGeometry
murermader Jan 13, 2025
b189937
CypherGeoFunctionsTest add comment
murermader Jan 13, 2025
48a8483
GIS: Use distanceField variable everywhere instead of _distance
murermader Jan 21, 2025
94305fe
GIS: compareResults now correctly compares both dictionaries
murermader Jan 21, 2025
c3a33f8
CypherTestTemplate: Database is now created on "hsqldb" by default
murermader Jan 21, 2025
b1af10e
GIS: Add method to run query on hsqldb and Neo4j and then compare res…
murermader Jan 21, 2025
92fabfa
GIS: Make PolyGeometry constructor public that parses GeoJSON
murermader Jan 22, 2025
2debcde
GIS: When converting from Neoj4 -> HSQLDB: Longitude comes first when…
murermader Jan 22, 2025
29c002d
GIS: convertMapToPolyGeometry now automatically converts Integer to D…
murermader Jan 22, 2025
9c4dd7a
CypherGeoFunctionsTest: Add method to extract value from result + tes…
murermader Jan 22, 2025
4f12a2a
GIS: Add code to benchmark $geoWithin in HSQL and MongoDB
murermader Jan 27, 2025
19019f8
GIS: Add two more benchmarks for $geoIntersects and $centerSphere
murermader Jan 27, 2025
5a70c59
GIS: Add benchmark docGeoWithinWithIndex
murermader Jan 28, 2025
188724c
GIS: Generate queries randomly to prevent DBs from caching results
murermader Jan 29, 2025
ad1ca96
Neo4jPlugin: Added TODO for error when restoring data from Neo4j
murermader Jan 29, 2025
997f3ed
MqlGeoFunctionsTest: Assert that there is a result for each query
murermader Feb 4, 2025
77022b8
MongoSort: get name from fieldExps instead of fields. Fixes MongoSort…
murermader Feb 4, 2025
4977f3d
MqlGeoFunctionsTest: Add unit test to check if mql sort works
murermader Feb 4, 2025
f98310a
MqlGeoFunctionsBenchmark: Update benchmark code
murermader Feb 4, 2025
26669df
Try fix MQL sort (internal)
murermader Feb 5, 2025
f3bf4ba
GIS: Add CYPHER_DISTANCE_NEO4J to exactly match Neo4j behavior + allo…
murermader Feb 10, 2025
5f1863b
GIS: pass beforeFields to getOpAsNeo to resolve indexes to fields
murermader Feb 10, 2025
484fe5b
GIS: Add distanceNeo4jTest, to validate that the distance operator is…
murermader Feb 11, 2025
be69593
GIS: allow point.withinBBox() to be pushed down to Neo4j + compare re…
murermader Feb 11, 2025
5c1456e
GIS: Add point.withinGeometry to Cypher + rename CYPHER_WITHIN_BBOX +…
murermader Feb 11, 2025
f04e3bf
Merge branch 'master' into multimodel-gis2
murermader Feb 12, 2025
ab6c5e5
Remove duplicate code from merge
murermader Feb 12, 2025
381824a
Remove log.warn
murermader Feb 12, 2025
c0f169a
GIS: distanceNeo4j can now be called by overloading the default point…
murermader Feb 15, 2025
09c478e
Merge branch 'master' into multimodel-gis2
murermader Feb 15, 2025
5d2def5
PolyGeometry.toWKT(): Check that the coordinates are not null before …
murermader Feb 15, 2025
5f37c6c
PolyGeometry.toWKT(): Only include Z for point if it is not 0.
murermader Feb 15, 2025
5e7e593
GIS: Add DocumentGeoNearUnwrap to handle MQL_GEO_NEAR (aggregation pi…
murermader Feb 15, 2025
f82a182
GIS: Create $geoNear as LogicalDocumentFilter
murermader Feb 23, 2025
6efcfdc
GIS: Convert $geoNear to operations inside DocumentGeoNearUnwrap + tr…
murermader Feb 24, 2025
ebef363
GIS: $geoNear addLocation now correctly an array, if near is also an …
murermader Feb 25, 2025
403bedb
GIS: $geoNear handle case where query there is no query, fixed how th…
murermader Feb 25, 2025
c008c50
GIS: MqlGeoFunctionsTest cleanup
murermader Feb 25, 2025
f0b00e9
GIS: Add comment that docGeoNearTest currently fails
murermader Feb 25, 2025
0cffb07
Revert "SQL: Allow the usage of the word TEMPERATURE in variables"
murermader Feb 26, 2025
d0cc5e3
BsonUtil: Fix how values inside Documents are handled in BsonUtil, fo…
murermader Feb 27, 2025
0a075a0
fixed merge conflicts with master
datomo Aug 12, 2025
c144278
added missing methods
datomo Aug 12, 2025
51c314c
adjusted mapping of points in neo4j adapter
datomo Oct 25, 2025
89d2555
fixed response of document for non document stores
datomo Oct 25, 2025
b2f0183
Merge branch 'master' of https://github.com/polypheny/Polypheny-DB in…
datomo Oct 26, 2025
6b32bad
fixes for some failing tests
datomo Oct 26, 2025
b9a98a6
sub orders correctly, mongo ignores
datomo Nov 2, 2025
a18b28e
fixed sort for geo fields
datomo Nov 3, 2025
3f04445
Merge branch 'master' of github.com:polypheny/Polypheny-DB into gis-f…
datomo Nov 3, 2025
8bc0287
fixed relational sort in mongo
datomo Nov 3, 2025
6da5694
fixed most mongodb errors
datomo Nov 3, 2025
a95ca1c
disabled impossible alg test
datomo Nov 3, 2025
dd9c547
improved stability for docker instance during testing, assigned cyphe…
datomo Nov 5, 2025
c7b804c
fixed adapter geo tests
datomo Nov 5, 2025
ac61473
fixed cypher rid for test
datomo Nov 5, 2025
521473c
added test for cleanup
datomo Nov 5, 2025
91e31c4
added sleep in geo tests to wait for docker
datomo Nov 5, 2025
78d5810
reverted sleep in geo test
datomo Nov 5, 2025
721e71e
added sleep at correct location
datomo Nov 5, 2025
dfe1448
added tag for docker tests, allowing exclusion on platform tests
datomo Nov 5, 2025
c4e0d1e
tagged docker test
datomo Nov 5, 2025
17a1c21
removed incorrect singleton access
datomo Nov 5, 2025
97be0db
separate stores for different test to identify potential errors
datomo Nov 5, 2025
fb8015c
fixed checking for stores
datomo Nov 5, 2025
7fda003
fixed correct removal of test adapter
datomo Nov 6, 2025
c81fc44
adjusted geo test example to conform
datomo Nov 6, 2025
663f9d5
adjusted geo tests for file
datomo Nov 6, 2025
afab330
adjustment to file geo tests
datomo Nov 6, 2025
122fbb0
replaced vars with explicit types, fixed formatting
datomo Nov 7, 2025
a2dd3d2
updated licensee text
datomo Nov 7, 2025
de7980b
removed todo
datomo Nov 7, 2025
e2f9aa3
removed gradle artifact
datomo Nov 7, 2025
1492b54
removed log statement
datomo Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
run: ./gradlew assemblePlugins -PwithoutpullingUi=true
- name: Execute tests
timeout-minutes: 30
run: ./gradlew check -PwithoutpullingUi=true
run: ./gradlew platformTests -PwithoutpullingUi=true
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ allprojects {
}
integrationTests.dependsOn(testClasses)

// matrix tests exclude tests which rely on docker during testing due to different platform requirements
tasks.register('platformTests', Test) {
description = 'Runs platform tests.'
group = 'verification'
useJUnitPlatform {
excludeTags("docker")
}
shouldRunAfter(tasks.named('test'))
}
platformTests.dependsOn(testClasses)

testlogger {
theme 'standard'
showExceptions true
Expand Down
13 changes: 13 additions & 0 deletions core/src/main/java/org/polypheny/db/algebra/constant/Kind.java
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,19 @@ public enum Kind {
* Document model {@code $exists} operator
*/
MQL_EXISTS,

MQL_GEO_INTERSECTS,

MQL_GEO_WITHIN,

MQL_GEO_DISTANCE,

MQL_NEAR,

MQL_NEAR_SPHERE,

MQL_GEO_NEAR,

/*
* Deserialize operator
*/
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/org/polypheny/db/algebra/core/Join.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,4 @@ public PolyAlgArgs bindArguments() {
return args;
}


}
2 changes: 2 additions & 0 deletions core/src/main/java/org/polypheny/db/algebra/core/Sort.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public abstract class Sort extends SingleAlg {
*/
@Getter
public final AlgCollation collation;

@Getter
protected final ImmutableList<RexNode> fieldExps;
public final RexNode offset;
public final RexNode fetch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -47,17 +48,22 @@ public abstract class DocumentProject extends SingleAlg implements DocumentAlg {

public Map<String, ? extends RexNode> includes;
public List<String> excludes;
public Map<String, ? extends RexNode> adds;


/**
* Creates a {@link DocumentProject}.
* {@link ModelTrait#DOCUMENT} native node of a project.
*/
protected DocumentProject( AlgCluster cluster, AlgTraitSet traits, AlgNode input, @NotNull Map<String, ? extends RexNode> includes, @NotNull List<String> excludes ) {
protected DocumentProject( AlgCluster cluster, AlgTraitSet traits, AlgNode input, @NotNull Map<String, ? extends RexNode> includes, @NotNull List<String> excludes, @NotNull Map<String, ? extends RexNode> adds ) {
super( cluster, traits, input );
this.includes = includes;
this.adds = adds;
this.excludes = excludes;
this.rowType = DocumentType.ofIncludes( includes ).ofExcludes( excludes );
Map<String, RexNode> map = new HashMap<>();
map.putAll( adds );
map.putAll( includes );
this.rowType = DocumentType.ofIncludes( map ).ofExcludes( excludes );
}


Expand Down Expand Up @@ -97,6 +103,20 @@ public RexNode asSingleProject() {
builder.getTypeFactory().createArrayType( builder.getTypeFactory().createPolyType( PolyType.CHAR, 255 ), -1 ), PolyType.ARRAY ) );
nodes.addAll( includes.entrySet().stream().filter( o -> Objects.nonNull( o.getKey() ) ).map( Entry::getValue ).toList() );

if ( !adds.isEmpty() ) {
nodes.clear();
nodes.add( doc );
nodes.add(
builder.makeLiteral(
PolyList.copyOf( adds.keySet().stream().filter( Objects::nonNull ).map( v -> PolyList.copyOf( Arrays.stream( v.split( "\\." ) ).map( PolyString::of ).toList() ) )
.toList() ),
builder.getTypeFactory().createArrayType( builder.getTypeFactory().createPolyType( PolyType.CHAR, 255 ), -1 ), PolyType.ARRAY ) );
nodes.addAll( adds.entrySet().stream().filter( o -> Objects.nonNull( o.getKey() ) ).map( Entry::getValue ).toList() );

doc = builder.makeCall( getTupleType(), OperatorRegistry.get( QueryLanguage.from( "mongo" ), OperatorName.MQL_MERGE_ADD ), nodes );
return doc;
}

if ( !includes.isEmpty() ) {
doc = builder.makeCall( getTupleType(), OperatorRegistry.get( QueryLanguage.from( "mongo" ), OperatorName.MQL_MERGE ), nodes );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,5 @@ public PolyAlgArgs bindArguments() {
.put( "flattened", new BooleanArg( isFlattened() ) );
}


}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2024 The Polypheny Project
* Copyright 2019-2025 The Polypheny Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ private void defineCypherMethods() {
defineMethod( OperatorRegistry.get( cypher, OperatorName.CYPHER_SET_LABELS ), BuiltInMethod.CYPHER_SET_LABELS.method, NullPolicy.NONE );
defineMethod( OperatorRegistry.get( cypher, OperatorName.CYPHER_REMOVE_LABELS ), BuiltInMethod.CYPHER_REMOVE_LABELS.method, NullPolicy.NONE );
defineMethod( OperatorRegistry.get( cypher, OperatorName.CYPHER_REMOVE_PROPERTY ), BuiltInMethod.CYPHER_REMOVE_PROPERTY.method, NullPolicy.NONE );
defineMethod( OperatorRegistry.get( cypher, OperatorName.CYPHER_POINT ), BuiltInMethod.CYPHER_POINT.method, NullPolicy.NONE );
defineMethod( OperatorRegistry.get( cypher, OperatorName.DISTANCE ), BuiltInMethod.CYPHER_DISTANCE.method, NullPolicy.NONE );
defineMethod( OperatorRegistry.get( cypher, OperatorName.DISTANCE_NEO4J ), BuiltInMethod.CYPHER_DISTANCE_NEO4J.method, NullPolicy.NONE );
defineMethod( OperatorRegistry.get( cypher, OperatorName.CYPHER_WITHIN_BBOX ), BuiltInMethod.CYPHER_WITHIN_BBOX.method, NullPolicy.NONE );
defineMethod( OperatorRegistry.get( cypher, OperatorName.CYPHER_WITHIN_GEOMETRY ), BuiltInMethod.CYPHER_WITHIN_GEOMETRY.method, NullPolicy.NONE );
}


Expand Down Expand Up @@ -503,10 +508,13 @@ private void defineMongoMethods() {
defineMethod( OperatorRegistry.get( mongo, OperatorName.MQL_REMOVE ), BuiltInMethod.MQL_REMOVE.method, NullPolicy.STRICT );
defineMethod( OperatorRegistry.get( mongo, OperatorName.MQL_EXISTS ), BuiltInMethod.MQL_EXISTS.method, NullPolicy.STRICT );
defineMethod( OperatorRegistry.get( mongo, OperatorName.MQL_MERGE ), BuiltInMethod.MQL_MERGE.method, NullPolicy.STRICT );
defineMethod( OperatorRegistry.get( mongo, OperatorName.MQL_MERGE_ADD ), BuiltInMethod.MQL_MERGE_ADD.method, NullPolicy.STRICT );
defineMethod( OperatorRegistry.get( mongo, OperatorName.MQL_PROJECT_INCLUDES ), BuiltInMethod.MQL_PROJECT_INCLUDES.method, NullPolicy.STRICT );
defineMethod( OperatorRegistry.get( mongo, OperatorName.MQL_REPLACE_ROOT ), BuiltInMethod.MQL_REPLACE_ROOT.method, NullPolicy.STRICT );
defineMethod( OperatorRegistry.get( mongo, OperatorName.MQL_NOT_UNSET ), BuiltInMethod.MQL_NOT_UNSET.method, NullPolicy.STRICT );

defineImplementor( OperatorRegistry.get( mongo, OperatorName.MQL_GEO_INTERSECTS ), NullPolicy.NONE, new MethodImplementor( BuiltInMethod.MQL_GEO_INTERSECTS.method ), false );
defineImplementor( OperatorRegistry.get( mongo, OperatorName.MQL_GEO_WITHIN ), NullPolicy.NONE, new MethodImplementor( BuiltInMethod.MQL_GEO_WITHIN.method ), false );
defineImplementor( OperatorRegistry.get( mongo, OperatorName.MQL_GEO_DISTANCE ), NullPolicy.NONE, new MethodImplementor( BuiltInMethod.MQL_GEO_DISTANCE.method ), false );
defineMqlMethod( OperatorName.PLUS, "plus", NullPolicy.STRICT );
defineMqlMethod( OperatorName.MINUS, "minus", NullPolicy.STRICT );
defineMqlMethod( OperatorName.MULTIPLY, "multiply", NullPolicy.STRICT );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void onMatch( AlgOptRuleCall call ) {

// RexNode doc = builder.getRexBuilder().makeCall( DocumentType.ofId(), OperatorRegistry.get( QueryLanguage.from( "mongo" ), OperatorName.MQL_MERGE ), nodes );

call.transformTo( LogicalDocumentProject.create( enumerableAggregate, docs, List.of() ) );
call.transformTo( LogicalDocumentProject.create( enumerableAggregate, docs, List.of(), Map.of() ) );
// call.transformTo( LogicalAggregate.create( alg.getInput(), alg.groupSet, alg.groupSets, alg.aggCalls ) );*/
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2024 The Polypheny Project
* Copyright 2019-2025 The Polypheny Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,10 +22,12 @@
import org.polypheny.db.algebra.core.document.DocumentFilter;
import org.polypheny.db.algebra.enumerable.EnumerableCalc;
import org.polypheny.db.algebra.enumerable.EnumerableConvention;
import org.polypheny.db.algebra.enumerable.document.DocumentProjectToCalcRule.NearDetector;
import org.polypheny.db.algebra.logical.document.LogicalDocumentFilter;
import org.polypheny.db.algebra.operators.OperatorName;
import org.polypheny.db.algebra.type.AlgDataType;
import org.polypheny.db.algebra.type.DocumentType;
import org.polypheny.db.algebra.type.AlgDataTypeField;
import org.polypheny.db.catalog.logistic.DataModel;
import org.polypheny.db.languages.OperatorRegistry;
import org.polypheny.db.languages.QueryLanguage;
import org.polypheny.db.plan.AlgCluster;
Expand Down Expand Up @@ -53,13 +55,20 @@ public DocumentFilterToCalcRule() {
@Override
public AlgNode convert( AlgNode alg ) {
final LogicalDocumentFilter filter = (LogicalDocumentFilter) alg;

NearDetector nearDetector = new NearDetector();
filter.accept( nearDetector );
if ( nearDetector.containsNear ) {
return null;
}

final AlgNode input = filter.getInput();

// Create a program containing a filter.
final RexBuilder rexBuilder = filter.getCluster().getRexBuilder();
final AlgDataType inputRowType = input.getTupleType();
final RexProgramBuilder programBuilder = new RexProgramBuilder( inputRowType, rexBuilder );
NameRefReplacer replacer = new NameRefReplacer( filter.getCluster(), false );
NameRefReplacer replacer = new NameRefReplacer( filter.getCluster(), false, alg.getInput( 0 ) );
programBuilder.addIdentity();
programBuilder.addCondition( filter.condition.accept( replacer ) );
final RexProgram program = programBuilder.getProgram();
Expand All @@ -74,26 +83,32 @@ public AlgNode convert( AlgNode alg ) {
public static class NameRefReplacer extends RexShuttle {

private final AlgCluster cluster;
private final AlgNode input;
boolean inplace;


public NameRefReplacer( AlgCluster cluster, boolean inplace ) {
public NameRefReplacer( AlgCluster cluster, boolean inplace, AlgNode input ) {
this.cluster = cluster;
this.inplace = inplace;
this.input = input;
}


@Override
public RexNode visitNameRef( RexNameRef nameRef ) {
int index = 0;
if ( input.getModel() == DataModel.RELATIONAL ) {
// within document model we just access the main field, if already mapped we use the data field
index = input.getTupleType().getFields().stream().filter( f -> f.getName().equals( "_data" ) ).map( AlgDataTypeField::getIndex ).findAny().orElse( 0 );
}

return new RexCall(
nameRef.getType(),
OperatorRegistry.get( QueryLanguage.from( "mql" ), OperatorName.MQL_QUERY_VALUE ),
RexIndexRef.of( 0, DocumentType.ofDoc() ),
RexIndexRef.of( index, input.getTupleType() ),
DocumentUtil.getStringArray( nameRef.names, cluster ) );
}


}


}
Loading