Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spark 4.0.0 (preview1) #1253

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
1c97b40
Merge branch 'master' into Spark3.3
ghislainfourny May 4, 2023
1b41e02
Merge branch 'master' into Spark3.3
ghislainfourny May 16, 2023
3bebc9e
Fix parsing.
May 16, 2023
b73a128
Update to Spark 3.5.
Dec 21, 2023
9d0bfc4
Upgrade to AntLR 4.9.3.
Dec 21, 2023
570b548
Change jackson version to align with Spark.
Dec 21, 2023
c9931b3
Fix test.
Dec 21, 2023
1803a5c
Fix tests.
Dec 21, 2023
1d1d9f6
Fix tests.
Dec 21, 2023
524667d
Fix tests.
Dec 21, 2023
f745e31
Merge branch 'master' into Spark3.5.0
ghislainfourny Feb 27, 2024
c52ff1f
Fix test.
Feb 27, 2024
4aef769
Fix test.
Feb 27, 2024
debaef5
Merge branch 'master' into Spark3.5.0
ghislainfourny Feb 27, 2024
4b619b4
Merge branch 'master' into Spark3.5.0
ghislainfourny Feb 27, 2024
c6f13df
Upgrade version.
Jul 9, 2024
168ef42
Update to Scala 13.
Jul 9, 2024
9cbcb5d
Fix build.
Jul 9, 2024
1cb8886
Upgrade Java.
Jul 9, 2024
e8febcd
Update javadoc plugin.
Jul 9, 2024
bc7b879
Upgrade lang3.
Jul 9, 2024
3205386
Upgrade Java.
Jul 9, 2024
8e31e34
Update jackson and avro.
Jul 9, 2024
d83f4b6
Regenerate with ANTLR 4.13.1.
Jul 10, 2024
53f9c45
Upgrade ANTLR.
Jul 10, 2024
edce372
Upload ANTLR 4.13.
Jul 10, 2024
e124a2f
Update Kryo.
Jul 10, 2024
b4a49cb
Regenerate.
Jul 10, 2024
45d835f
Fix tests.
Jul 10, 2024
fe6ce71
Fix test.
Jul 10, 2024
6dd9359
Add args to Bugs test.
Jul 10, 2024
364590e
Cleanup.
Jul 10, 2024
1886b31
Expand imports.
Jul 11, 2024
a4499f0
Fix test.
Jul 11, 2024
4dbe3b8
Improve code.
Jul 11, 2024
bf55238
Fix tests.
Jul 11, 2024
65251ee
Change ArraySeq to mutable in ItemParser.
Jul 11, 2024
d114f47
Fix tests.
Jul 11, 2024
53d6588
Regenerate XQuery parser and lexer.
Jul 11, 2024
5cd084f
Regenerate XQuery lexer.
Jul 11, 2024
7134260
Fix test.
Jul 11, 2024
f4a6489
Fix spotless.
Jul 11, 2024
1cac274
Add opens parameter.
Jul 11, 2024
b2dadbe
Add exports.
Jul 11, 2024
e00d1b7
Fix spotless.
Jul 11, 2024
f857063
Fix test.
Jul 11, 2024
7603ac0
Increase compiler version.
Jul 11, 2024
feba9db
Update source/target.
Jul 11, 2024
57b77ad
Update compiler versions.
Jul 12, 2024
7578b76
Add qualifiers.
Jul 12, 2024
09be82b
Debig mvn install.
Jul 12, 2024
1eb8851
Display maven version.
Jul 12, 2024
4a594b3
Bump actions versions.
Jul 12, 2024
d69d536
Downgrade versions.
Jul 12, 2024
432280c
Revert "Downgrade versions."
Jul 12, 2024
9652cd2
Revert "Bump actions versions."
Jul 12, 2024
8622011
Revert "Display maven version."
Jul 12, 2024
38c6266
Revert "Debig mvn install."
Jul 12, 2024
9fe0f74
Revert "Add qualifiers."
Jul 12, 2024
e7e0f27
Revert "Update compiler versions."
Jul 12, 2024
8bbf539
Small version bump.
Jul 12, 2024
302d942
ecj plugin 23.
Jul 12, 2024
e002a39
ecj plugin 24.
Jul 12, 2024
11ac903
ecj plugin 25.
Jul 12, 2024
ac66b0f
ecj plugin 26.
Jul 12, 2024
673c6e6
ecj plugin 27.
Jul 12, 2024
a0c9880
plexus 9.
Jul 12, 2024
d18ee41
ecj plugin 28.
Jul 12, 2024
e2945c7
plexus 10.
Jul 12, 2024
2af438b
plexus 11.
Jul 12, 2024
f427e82
ecj plugin 29.
Jul 12, 2024
19f9077
ecj plugin 30.
Jul 12, 2024
d08e39b
plexus 12.
Jul 12, 2024
8a1d71a
ecj plugin 31.
Jul 12, 2024
76dab85
ecj plugin 32.
Jul 12, 2024
2afb9e5
plexus 13.
Jul 12, 2024
52fb752
ecj plugin 33.
Jul 12, 2024
86c6bbc
ecj plugin 34.
Jul 12, 2024
e61f152
ecj plugin 35.
Jul 12, 2024
53cc57e
ecj plugin 36.
Jul 12, 2024
bd0d237
Move to preview2.
Oct 28, 2024
295bb11
Merge master.
Oct 28, 2024
31bb3f7
Fix compile error.
Oct 28, 2024
d9c3d5a
Merge branch 'master' into Spark4.0.0
ghislainfourny Oct 28, 2024
50bc144
Update delta version.
Oct 28, 2024
361a07a
Merge branch 'Spark4.0.0' of github.com:RumbleDB/rumble into Spark4.0.0
Oct 28, 2024
b202da7
Fix delta module.
Oct 28, 2024
478b1f2
Update delta version to match Spark 4.
Oct 28, 2024
df3487e
Merge branch 'master' into Spark4.0.0
ghislainfourny Oct 28, 2024
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
12 changes: 6 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Java 11
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: adopt
- name: Cache Maven packages
uses: actions/cache@v3
Expand Down Expand Up @@ -55,10 +55,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Java 11
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: adopt
- name: Cache Maven packages
uses: actions/cache@v3
Expand All @@ -85,10 +85,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Java 11
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: adopt
- name: Cache Maven packages
uses: actions/cache@v3
Expand Down
Binary file added lib/antlr-4.13.1-complete.jar
Binary file not shown.
59 changes: 34 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,34 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<!-- Holy grail of eclipse configuration: https://stackoverflow.com/a/49599478/10707488 -->
<configuration>
<compilerId>eclipse</compilerId>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<properties>${project.basedir}/org.eclipse.jdt.core.prefs</properties>
</compilerArguments>
<source>11</source>
<target>11</target>
<compilerArgs>
<arg>-properties</arg>
<arg>${project.basedir}/org.eclipse.jdt.core.prefs</arg>
</compilerArgs>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.5</version>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.20.0</version>
<version>3.36.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<version>3.4.2</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -107,7 +108,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.7.0</version>
<configuration>
<excludePackageNames>org.rumbledb.cli:org.rumbledb.config:sparksoniq.*:sparksoniq</excludePackageNames>
</configuration>
Expand Down Expand Up @@ -193,6 +194,14 @@
</java>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<argLine>--add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-exports=java.base/sun.util.calendar=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>

Expand All @@ -209,37 +218,37 @@
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.12</artifactId>
<version>3.4.2</version>
<artifactId>spark-core_2.13</artifactId>
<version>4.0.0-preview2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.12</artifactId>
<version>3.4.2</version>
<artifactId>spark-sql_2.13</artifactId>
<version>4.0.0-preview2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.12</artifactId>
<version>3.4.2</version>
<artifactId>spark-mllib_2.13</artifactId>
<version>4.0.0-preview2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-aws</artifactId>
<version>3.3.2</version>
<version>3.3.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-avro_2.12</artifactId>
<version>3.4.2</version>
<artifactId>spark-avro_2.13</artifactId>
<version>4.0.0-preview2</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.9.3</version>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>org.jline</groupId>
Expand All @@ -249,7 +258,7 @@
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
<version>4.0.2</version>
<version>5.6.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand All @@ -265,7 +274,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
<version>3.14.0</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
Expand Down Expand Up @@ -300,12 +309,12 @@
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.13.4</version>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>io.delta</groupId>
<artifactId>delta-core_2.12</artifactId>
<version>2.4.0</version>
<artifactId>delta-spark_2.13</artifactId>
<version>4.0.0rc1</version>
</dependency>
</dependencies>

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/rumbledb/api/Rumble.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.rumbledb.context.DynamicContext;
import org.rumbledb.expressions.module.MainModule;
import org.rumbledb.runtime.RuntimeIterator;
import org.rumbledb.runtime.update.PendingUpdateList;

import sparksoniq.spark.SparkSessionManager;

import java.io.IOException;
Expand Down Expand Up @@ -72,6 +74,11 @@ public SequenceOfItems runQuery(URI location) throws IOException {
this.configuration
);

if (iterator.isUpdating()) {
PendingUpdateList pul = iterator.getPendingUpdateList(dynamicContext);
pul.applyUpdates(iterator.getMetadata());
}

return new SequenceOfItems(iterator, dynamicContext, this.configuration);
}

Expand Down
12 changes: 8 additions & 4 deletions src/main/java/org/rumbledb/cli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ public class Main {

public static void main(String[] args) throws IOException {
String javaVersion = System.getProperty("java.version");
if (!javaVersion.startsWith("11.") && !javaVersion.startsWith("17.")) {
System.err.println("[Error] RumbleDB requires Java 11 or 17.");
if (
!javaVersion.startsWith("11")
&& !javaVersion.startsWith("17")
&& !javaVersion.startsWith("21")
) {
System.err.println("[Error] RumbleDB requires Java 11, 17 or 21 (17 being the default Spark 4 version).");
System.err.println("Your Java version: " + System.getProperty("java.version"));
System.err.println("You can download Java 11 or 17 from https://adoptium.net/");
System.err.println("You can download Java 11, 17 or 21 from https://adoptium.net/");
System.err.println(
"If you do have Java 11 or 17, but the wrong version appears above, then it means you need to set your JAVA_HOME environment variable properly to point to Java 11 or 17."
"If you do have Java 11, 17 or 21, but the wrong version appears above, then it means you need to set your JAVA_HOME environment variable properly to point to Java 11, 17 or 21."
);
System.exit(43);
}
Expand Down
15 changes: 10 additions & 5 deletions src/main/java/org/rumbledb/items/parsing/ItemParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
import org.rumbledb.types.BuiltinTypesCatalogue;
import org.rumbledb.types.FieldDescriptor;
import org.rumbledb.types.ItemType;
import scala.collection.mutable.WrappedArray;
import scala.collection.immutable.ArraySeq;
import scala.collection.Iterator;
import sparksoniq.spark.SparkSessionManager;

import java.io.IOException;
import java.io.Serializable;
import java.io.StringReader;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Date;
Expand Down Expand Up @@ -589,9 +589,14 @@ private static Item convertValueToItem(
}
} else {
@SuppressWarnings("unchecked")
Object arrayObject = ((WrappedArray<Object>) o).array();
for (int index = 0; index < Array.getLength(arrayObject); index++) {
Object value = Array.get(arrayObject, index);
Iterator<Object> iterator = null;
if (o instanceof scala.collection.mutable.ArraySeq) {
iterator = ((scala.collection.mutable.ArraySeq<Object>) o).iterator();
} else {
iterator = ((ArraySeq<Object>) o).iterator();
}
while (iterator.hasNext()) {
Object value = iterator.next();
members.add(convertValueToItem(value, dataType, metadata, memberType));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/rumbledb/parser/Jsoniq.interp

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/main/java/org/rumbledb/parser/JsoniqBaseVisitor.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from ./src/main/java/org/rumbledb/parser/Jsoniq.g4 by ANTLR 4.9.3
// Generated from ./src/main/java/org/rumbledb/parser/Jsoniq.g4 by ANTLR 4.13.1

// Java header
package org.rumbledb.parser;
Expand All @@ -13,6 +13,7 @@
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
@SuppressWarnings("CheckReturnValue")
public class JsoniqBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements JsoniqVisitor<T> {
/**
* {@inheritDoc}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/rumbledb/parser/JsoniqLexer.interp

Large diffs are not rendered by default.

Loading
Loading