-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(translator): Provide a module containing a translator aiming spe…
…cifically at Spark generated queries. Spark will wrap most queries in a subquery, using it as a derived table. This will often lead to the outer query being a SQL statement, containing possible Cypher as the derived table. The SQL to Cypher translator will be unhappy with that. So this additional translator might be configured to run _before_ the SQL to Cypher translator, so that it can unwrap the inner query if it's cypher, wrap in in a `CALL {}` statement and than skip SQL to Cypher translation. Signed-off-by: Michael Simons <[email protected]>
- Loading branch information
1 parent
b1e3435
commit b0416d8
Showing
17 changed files
with
627 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2023-2025 "Neo4j," | ||
Neo4j Sweden AB [https://neo4j.com] | ||
This file is part of Neo4j. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.neo4j</groupId> | ||
<artifactId>neo4j-jdbc-translator</artifactId> | ||
<version>6.1.2-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>neo4j-jdbc-translator-sparkcleaner</artifactId> | ||
|
||
<packaging>jar</packaging> | ||
<name>Neo4j JDBC Driver (Spark preparing Translator)</name> | ||
<description>A specialized translator unwrapping Spark subqueries</description> | ||
|
||
<properties> | ||
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.neo4j</groupId> | ||
<artifactId>cypher-v5-antlr-parser</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.neo4j</groupId> | ||
<artifactId>neo4j-jdbc-translator-spi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.siom79.japicmp</groupId> | ||
<artifactId>japicmp-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<!-- First shade the things we won't definitely not have as dependency --> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<phase>package</phase> | ||
<configuration> | ||
<artifactSet> | ||
<includes> | ||
<include>org.neo4j:cypher-antlr-common</include> | ||
<include>org.neo4j:cypher-v5-antlr-parser</include> | ||
<include>org.antlr:antlr4-runtime</include> | ||
</includes> | ||
</artifactSet> | ||
<relocations> | ||
<relocation> | ||
<pattern>org.antlr</pattern> | ||
<shadedPattern>org.neo4j.jdbc.translator.sparkcleaner.internal.shaded.antlr</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>org.neo4j.cypher.internal.parser</pattern> | ||
<shadedPattern>org.neo4j.jdbc.translator.sparkcleaner.internal.shaded.parser.common</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>org.neo4j.cypher.internal.parser.v5</pattern> | ||
<shadedPattern>org.neo4j.jdbc.translator.sparkcleaner.internal.shaded.parser.v5</shadedPattern> | ||
</relocation> | ||
</relocations> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> | ||
</transformers> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>LICENSE.txt</exclude> | ||
<exclude>META-INF/LICENSE*.txt</exclude> | ||
<exclude>META-INF/MANIFEST.MF</exclude> | ||
<exclude>META-INF/NOTICE.txt</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<!-- Than add the module info --> | ||
<groupId>org.moditect</groupId> | ||
<artifactId>moditect-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>add-module-infos</id> | ||
<goals> | ||
<goal>add-module-info</goal> | ||
</goals> | ||
<phase>package</phase> | ||
<configuration> | ||
<overwriteExistingFiles>true</overwriteExistingFiles> | ||
<module> | ||
<moduleInfoSource>module org.neo4j.jdbc.translator.sparkcleaner { | ||
provides org.neo4j.jdbc.translator.spi.TranslatorFactory with org.neo4j.jdbc.translator.sparkcleaner.SparkSubqueryCleaningTranslatorFactory; | ||
requires org.neo4j.jdbc.translator.spi; | ||
}</moduleInfoSource> | ||
</module> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Oops, something went wrong.