Skip to content

Commit db06b4d

Browse files
Merge branch 'master' into Spark4.1.0
2 parents a6bd7c5 + 054431f commit db06b4d

1,121 files changed

Lines changed: 27988 additions & 19994 deletions

File tree

Some content is hidden

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

.github/workflows/maven.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ jobs:
8181
"XMLTests",
8282
"XQueryTests",
8383
"DeltaUpdateRuntimeTests",
84-
"IcebergUpdateRuntimeTests"
84+
"IcebergUpdateRuntimeTests",
85+
"org.rumbledb.**.*Test"
8586
]
8687
steps:
8788
- uses: actions/checkout@v5
@@ -101,7 +102,7 @@ jobs:
101102
name: Package
102103
path: target
103104
- name: Run Test ${{ matrix.test_class }}
104-
run: mvn -Dtest=${{ matrix.test_class }} test
105+
run: mvn -Dtest='${{ matrix.test_class }}' test
105106
- name: Publish Surefire Report ${{ matrix.test_class }}
106107
if: always()
107108
uses: ScalableCapital/action-surefire-report@v2

.gitignore

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,8 @@ derby.log
2222
src/main/java/jsound/
2323
src/main/resources/log4j.properties
2424

25-
/src/main/java/org/rumbledb/parser/jsoniq/
26-
!/src/main/java/org/rumbledb/parser/jsoniq/JsoniqParser.g4
27-
!/src/main/java/org/rumbledb/parser/jsoniq/JsoniqLexer.g4
28-
2925
# ANTLR
3026
*.tokens
3127
*.interp
3228

33-
# ANTLR generated files for XQuery parser
34-
/src/main/java/org/rumbledb/parser/xquery/XQueryParser.java
35-
/src/main/java/org/rumbledb/parser/xquery/XQueryParserBaseVisitor.java
36-
/src/main/java/org/rumbledb/parser/xquery/XQueryParserVisitor.java
37-
38-
# ANTLR generated files for XQuery lexer
39-
/src/main/java/org/rumbledb/parser/xquery/XQueryLexer.java
40-
4129
.vscode/settings.json

pom.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<groupId>com.github.rumbledb</groupId>
2828
<artifactId>rumbledb</artifactId>
29-
<version>2.1.0</version>
29+
<version>3.0.0</version>
3030
<packaging>jar</packaging>
3131
<name>RumbleDB</name>
3232
<description>A JSONiq engine to query large-scale JSON datasets stored on HDFS. Spark under the hood.</description>
@@ -274,6 +274,13 @@
274274
</eclipse>
275275
<removeUnusedImports/>
276276
</java>
277+
<antlr4>
278+
<includes>
279+
<include>src/main/java/org/rumbledb/parser/*/*.g4</include>
280+
</includes>
281+
282+
<antlr4Formatter />
283+
</antlr4>
277284
</configuration>
278285
</plugin>
279286
<plugin>
@@ -424,8 +431,8 @@
424431
</dependency>
425432
<dependency>
426433
<groupId>com.esotericsoftware</groupId>
427-
<artifactId>kryo</artifactId>
428-
<version>5.6.0</version>
434+
<artifactId>kryo-shaded</artifactId>
435+
<version>4.0.3</version>
429436
<scope>provided</scope>
430437
</dependency>
431438
<dependency>
@@ -525,6 +532,11 @@
525532
<version>${lombok.version}</version>
526533
<scope>provided</scope>
527534
</dependency>
535+
<dependency>
536+
<groupId>info.picocli</groupId>
537+
<artifactId>picocli</artifactId>
538+
<version>4.7.7</version>
539+
</dependency>
528540
</dependencies>
529541

530542
<distributionManagement>

server_tests_manual.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package org.rumbledb.api;
2+
3+
import org.apache.spark.sql.Dataset;
4+
import org.apache.spark.sql.Row;
5+
import org.rumbledb.bindings.ItemSequenceBinding;
6+
import org.rumbledb.bindings.DataFrameBinding;
7+
import org.rumbledb.bindings.LexicalBinding;
8+
import org.rumbledb.context.Name;
9+
10+
import java.util.List;
11+
12+
public class ExternalBindings {
13+
private final org.rumbledb.bindings.ExternalBindings bindings;
14+
15+
public ExternalBindings() {
16+
this.bindings = org.rumbledb.bindings.ExternalBindings.empty();
17+
}
18+
19+
public static ExternalBindings empty() {
20+
return new ExternalBindings();
21+
}
22+
23+
public void bindItem(String variableName, Item item) {
24+
this.bindItems(variableName, List.of(item));
25+
}
26+
27+
public void bindItems(String variableName, List<Item> items) {
28+
this.bindings.bind(Name.createVariableInNoNamespace(variableName), new ItemSequenceBinding(items));
29+
}
30+
31+
public void bindLiteral(String variableName, String value) {
32+
this.bindings.bind(Name.createVariableInNoNamespace(variableName), new LexicalBinding(value));
33+
}
34+
35+
public void bindDataFrame(String variableName, Dataset<Row> dataFrame) {
36+
this.bindings.bind(Name.createVariableInNoNamespace(variableName), new DataFrameBinding(dataFrame));
37+
}
38+
39+
public void unbind(String variableName) {
40+
this.bindings.unbind(Name.createVariableInNoNamespace(variableName));
41+
}
42+
43+
org.rumbledb.bindings.ExternalBindings getInternalBindings() {
44+
return this.bindings;
45+
}
46+
}

src/main/java/org/rumbledb/api/Item.java

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.rumbledb.api;
22

3-
import com.esotericsoftware.kryo.KryoSerializable;
43
import org.apache.spark.api.java.JavaRDD;
54
import org.apache.spark.ml.Estimator;
65
import org.apache.spark.ml.Transformer;
@@ -12,7 +11,7 @@
1211
import org.rumbledb.context.Name;
1312
import org.rumbledb.exceptions.DuplicateObjectKeyException;
1413
import org.rumbledb.exceptions.OurBadException;
15-
import org.rumbledb.items.structured.JSoundDataFrame;
14+
import org.rumbledb.items.structured.HomogeneousItemDataFrame;
1615
import org.rumbledb.items.xml.XMLDocumentPosition;
1716
import org.rumbledb.runtime.flwor.NativeClauseContext;
1817
import org.rumbledb.runtime.RuntimeIterator;
@@ -43,7 +42,7 @@
4342
*
4443
* @author Ghislain Fourny, Stefan Irimescu, Can Berker Cikis
4544
*/
46-
public interface Item extends Serializable, KryoSerializable {
45+
public interface Item extends Serializable {
4746

4847
/**
4948
* Makes a copy.
@@ -516,17 +515,6 @@ default boolean isObject() {
516515
return false;
517516
}
518517

519-
/**
520-
* Returns the string keys of the item, if it is a map.
521-
*
522-
* @return the list of the keys.
523-
* @deprecated use {@link #getStringKeys()} instead
524-
*/
525-
@Deprecated
526-
default List<String> getKeys() {
527-
return this.getStringKeys();
528-
}
529-
530518
/**
531519
* Returns the string keys of the item, if it is a map.
532520
*
@@ -548,17 +536,6 @@ default List<Item> getItemKeys() throws UnsupportedOperationException {
548536
throw new UnsupportedOperationException("Operation not defined for type " + this.getDynamicType());
549537
}
550538

551-
/**
552-
* Returns the values of the item, if it is a map.
553-
*
554-
* @return the list of the value items.
555-
* @deprecated use {@link #getItemValues()} instead
556-
*/
557-
@Deprecated
558-
default List<Item> getValues() {
559-
return this.getItemValues();
560-
}
561-
562539
/**
563540
* Returns the values of the item, if it is a map.
564541
*
@@ -784,17 +761,6 @@ default boolean hasKey(Item key) throws UnsupportedOperationException {
784761
throw new UnsupportedOperationException("Operation not defined for type " + this.getDynamicType());
785762
}
786763

787-
/**
788-
* Returns the members of the item if it is an array.
789-
*
790-
* @return the list of the array members.
791-
* @deprecated use {@link #getItemMembers()} instead
792-
*/
793-
@Deprecated
794-
default List<Item> getItems() {
795-
return this.getItemMembers();
796-
}
797-
798764
/**
799765
* Returns the members of the item, if it is an array.
800766
*
@@ -846,17 +812,6 @@ default List<Item> getSequenceAt(int position)
846812
throw new UnsupportedOperationException("Operation not defined for type " + this.getDynamicType());
847813
}
848814

849-
/**
850-
* Appends an item to the item, if it is an array.
851-
*
852-
* @param item the item to append.
853-
* @throws UnsupportedOperationException if the item is not an array.
854-
* @deprecated use {@link #appendItem(Item)} instead
855-
*/
856-
default void append(Item item) throws UnsupportedOperationException {
857-
this.appendItem(item);
858-
}
859-
860815
/**
861816
* Appends an item to the item, if it is an array.
862817
*
@@ -1032,6 +987,18 @@ default Duration getDurationValue() {
1032987
throw new UnsupportedOperationException("Operation not defined for type " + this.getDynamicType());
1033988
}
1034989

990+
/**
991+
* Returns the day-time (seconds) component of a duration item, i.e., the value of the
992+
* duration excluding its months component. Unlike getDurationValue(), this is not
993+
* anchored to any reference date, since days, hours, minutes and seconds have a fixed
994+
* length and can be converted to a Duration unambiguously.
995+
*
996+
* @return the day-time component as a Duration.
997+
*/
998+
default Duration getDayTimeDurationComponent() {
999+
throw new UnsupportedOperationException("Operation not defined for type " + this.getDynamicType());
1000+
}
1001+
10351002
/**
10361003
* Returns the EpochMillis of the item, if it's DateTime or Duration
10371004
* It will collect all the parts of the item and compress it into the EpochMillis
@@ -1137,7 +1104,7 @@ default Map<Name, JavaRDD<Item>> getRDDVariablesInClosure() {
11371104
*
11381105
* @return the function signature.
11391106
*/
1140-
default Map<Name, JSoundDataFrame> getDFVariablesInClosure() {
1107+
default Map<Name, HomogeneousItemDataFrame> getDFVariablesInClosure() {
11411108
throw new UnsupportedOperationException("Operation not defined for type " + this.getDynamicType());
11421109
}
11431110

0 commit comments

Comments
 (0)