Skip to content

Commit 53f4df0

Browse files
Merge pull request #1239 from RumbleDB/NoDFTests
No df tests
2 parents 42a662d + 173811b commit 53f4df0

File tree

186 files changed

+804
-705
lines changed

Some content is hidden

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

186 files changed

+804
-705
lines changed

.github/workflows/maven.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
run: mvn -Dtest=RuntimeTests test
3636
- name: RuntimeTestsNoParallelism
3737
run: mvn -Dtest=RuntimeTestsNoParallelism test
38+
- name: RuntimeTestsNoInlining
39+
run: mvn -Dtest=RuntimeTestsNoInlining test
3840
- name: StaticTypeTests
3941
run: mvn -Dtest=StaticTypeTests test
4042
- name: JavaAPITest
@@ -70,8 +72,12 @@ jobs:
7072
run: mvn clean compile assembly:single
7173
- name: SparkRuntimeTests
7274
run: mvn -Dtest=SparkRuntimeTests test
73-
- name: NativeFLWORRuntimeTests
74-
run: mvn -Dtest=NativeFLWORRuntimeTests test
75+
- name: SparkRuntimeTestsNativeDeactivated
76+
run: mvn -Dtest=SparkRuntimeTestsNativeDeactivated test
77+
- name: SparkRuntimeTestsDataFramesDeactivated
78+
run: mvn -Dtest=SparkRuntimeTestsDataFramesDeactivated test
79+
- name: SparkRuntimeTestsParallelismDeactivated
80+
run: mvn -Dtest=SparkRuntimeTestsParallelismDeactivated test
7581

7682
tests3:
7783

@@ -96,11 +102,16 @@ jobs:
96102
run: mvn clean compile assembly:single
97103
- name: Bugs
98104
run: mvn -Dtest=Bugs test
99-
- name: RuntimeTestsNoInlining
100-
run: mvn -Dtest=RuntimeTestsNoInlining test
105+
- name: NativeFLWORRuntimeTests
106+
run: mvn -Dtest=NativeFLWORRuntimeTests test
101107
- name: NativeFLWORRuntimeTestsNativeDeactivated
102108
run: mvn -Dtest=NativeFLWORRuntimeTestsNativeDeactivated test
103109
- name: NativeFLWORRuntimeTestsDataFramesDeactivated
104110
run: mvn -Dtest=NativeFLWORRuntimeTestsDataFramesDeactivated test
105111
- name: NativeFLWORRuntimeTestsParallelismDeactivated
106112
run: mvn -Dtest=NativeFLWORRuntimeTestsParallelismDeactivated test
113+
- name: MLTests
114+
run: mvn -Dtest=MLTests test
115+
- name: MLTestsNativeDeactivated
116+
run: mvn -Dtest=MLTestsNativeDeactivated test
117+

src/main/java/org/rumbledb/context/NamedFunctions.java

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public class NamedFunctions implements Serializable, KryoSerializable {
4949

5050
private static final long serialVersionUID = 1L;
5151

52-
// two maps for User defined function are needed as execution mode is known at static analysis phase
52+
// two maps for User defined function are needed as execution mode is known at
53+
// static analysis phase
5354
// but functions items are fully known at runtimeIterator generation
5455
private HashMap<FunctionIdentifier, FunctionItem> userDefinedFunctions;
5556
private RumbleRuntimeConfiguration conf;
@@ -78,11 +79,7 @@ public RuntimeIterator getUserDefinedFunctionCallIterator(
7879
arguments
7980
);
8081
}
81-
throw new UnknownFunctionCallException(
82-
identifier.getName(),
83-
identifier.getArity(),
84-
metadata
85-
);
82+
throw new UnknownFunctionCallException(identifier.getName(), identifier.getArity(), metadata);
8683

8784
}
8885

@@ -176,12 +173,7 @@ public static RuntimeIterator getBuiltInFunctionIterator(
176173
throw new UnknownFunctionCallException(identifier.getName(), identifier.getArity(), metadata);
177174
}
178175
for (int i = 0; i < arguments.size(); i++) {
179-
if (
180-
!builtinFunction.getSignature()
181-
.getParameterTypes()
182-
.get(i)
183-
.equals(SequenceType.ITEM_STAR)
184-
) {
176+
if (!builtinFunction.getSignature().getParameterTypes().get(i).equals(SequenceType.ITEM_STAR)) {
185177
SequenceType sequenceType = builtinFunction.getSignature().getParameterTypes().get(i);
186178
RuntimeStaticContext runtimeStaticContext = new RuntimeStaticContext(
187179
conf,
@@ -218,20 +210,18 @@ public static RuntimeIterator getBuiltInFunctionIterator(
218210
RuntimeIterator functionCallIterator;
219211
try {
220212
Constructor<? extends RuntimeIterator> constructor = builtinFunction.getFunctionIteratorClass()
221-
.getConstructor(
222-
List.class,
223-
RuntimeStaticContext.class
224-
);
213+
.getConstructor(List.class, RuntimeStaticContext.class);
225214
functionCallIterator = constructor.newInstance(
226215
arguments,
227-
new RuntimeStaticContext(conf, builtinFunction.getSignature().getReturnType(), executionMode, metadata)
216+
new RuntimeStaticContext(
217+
conf,
218+
builtinFunction.getSignature().getReturnType(),
219+
executionMode,
220+
metadata
221+
)
228222
);
229223
} catch (ReflectiveOperationException ex) {
230-
RuntimeException e = new UnknownFunctionCallException(
231-
identifier.getName(),
232-
arguments.size(),
233-
metadata
234-
);
224+
RuntimeException e = new UnknownFunctionCallException(identifier.getName(), arguments.size(), metadata);
235225
e.initCause(ex);
236226
throw e;
237227
}

src/main/java/org/rumbledb/expressions/primary/FunctionCallExpression.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void print(StringBuffer buffer, int indent) {
8282
for (int i = 0; i < indent; ++i) {
8383
buffer.append(" ");
8484
}
85-
buffer.append(getClass().getSimpleName());
85+
buffer.append(getClass().getSimpleName() + " (" + this.identifier + ")");
8686
buffer.append(" | " + this.highestExecutionMode);
8787
buffer.append(
8888
" | "

src/main/java/org/rumbledb/expressions/primary/InlineFunctionExpression.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void print(StringBuffer buffer, int indent) {
140140
buffer.append(" ");
141141
}
142142
buffer.append("Body:\n");
143-
this.body.print(buffer, indent + 2);
143+
this.body.print(buffer, indent + 4);
144144
}
145145

146146
@Override

src/main/java/org/rumbledb/items/Base64BinaryItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public Base64BinaryItem() {
4040
}
4141

4242
public Base64BinaryItem(String stringValue) {
43-
this.stringValue = stringValue;
4443
this.value = parseBase64BinaryString(stringValue);
44+
this.stringValue = StringUtils.chomp(Base64.encodeBase64String(this.value));
4545
}
4646

4747
@Override

src/main/java/org/rumbledb/parser/JsoniqBaseVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated from ./src/main/java/org/rumbledb/parser/Jsoniq.g4 by ANTLR 4.7
1+
// Generated from ./src/main/java/org/rumbledb/parser/Jsoniq.g4 by ANTLR 4.8
22

33
// Java header
44
package org.rumbledb.parser;

src/main/java/org/rumbledb/parser/JsoniqLexer.java

Lines changed: 67 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated from ./src/main/java/org/rumbledb/parser/Jsoniq.g4 by ANTLR 4.7
1+
// Generated from ./src/main/java/org/rumbledb/parser/Jsoniq.g4 by ANTLR 4.8
22

33
// Java header
44
package org.rumbledb.parser;
@@ -16,7 +16,7 @@
1616

1717
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
1818
public class JsoniqLexer extends Lexer {
19-
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
19+
static { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); }
2020

2121
protected static final DFA[] _decisionToDFA;
2222
protected static final PredictionContextCache _sharedContextCache =
@@ -49,63 +49,72 @@ public class JsoniqLexer extends Lexer {
4949
"DEFAULT_MODE"
5050
};
5151

52-
public static final String[] ruleNames = {
53-
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
54-
"T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16",
55-
"T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24",
56-
"T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32",
57-
"T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40",
58-
"T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "T__47", "T__48",
59-
"T__49", "T__50", "T__51", "T__52", "T__53", "T__54", "T__55", "T__56",
60-
"T__57", "T__58", "T__59", "Kfor", "Klet", "Kwhere", "Kgroup", "Kby",
61-
"Korder", "Kreturn", "Kif", "Kin", "Kas", "Kat", "Kallowing", "Kempty",
62-
"Kcount", "Kstable", "Kascending", "Kdescending", "Ksome", "Kevery", "Ksatisfies",
63-
"Kcollation", "Kgreatest", "Kleast", "Kswitch", "Kcase", "Ktry", "Kcatch",
64-
"Kdefault", "Kthen", "Kelse", "Ktypeswitch", "Kor", "Kand", "Knot", "Kto",
65-
"Kinstance", "Kof", "Kstatically", "Kis", "Ktreat", "Kcast", "Kcastable",
66-
"Kversion", "Kjsoniq", "Kunordered", "Ktrue", "Kfalse", "Ktype", "Kvalidate",
67-
"Kannotate", "Kdeclare", "Kcontext", "Kitem", "Kvariable", "STRING", "ESC",
68-
"UNICODE", "HEX", "ArgumentPlaceholder", "NullLiteral", "Literal", "NumericLiteral",
69-
"IntegerLiteral", "DecimalLiteral", "DoubleLiteral", "Digits", "WS", "NCName",
70-
"NameStartChar", "NameChar", "XQComment", "ContentChar"
71-
};
52+
private static String[] makeRuleNames() {
53+
return new String[] {
54+
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
55+
"T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16",
56+
"T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24",
57+
"T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32",
58+
"T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40",
59+
"T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "T__47", "T__48",
60+
"T__49", "T__50", "T__51", "T__52", "T__53", "T__54", "T__55", "T__56",
61+
"T__57", "T__58", "T__59", "Kfor", "Klet", "Kwhere", "Kgroup", "Kby",
62+
"Korder", "Kreturn", "Kif", "Kin", "Kas", "Kat", "Kallowing", "Kempty",
63+
"Kcount", "Kstable", "Kascending", "Kdescending", "Ksome", "Kevery",
64+
"Ksatisfies", "Kcollation", "Kgreatest", "Kleast", "Kswitch", "Kcase",
65+
"Ktry", "Kcatch", "Kdefault", "Kthen", "Kelse", "Ktypeswitch", "Kor",
66+
"Kand", "Knot", "Kto", "Kinstance", "Kof", "Kstatically", "Kis", "Ktreat",
67+
"Kcast", "Kcastable", "Kversion", "Kjsoniq", "Kunordered", "Ktrue", "Kfalse",
68+
"Ktype", "Kvalidate", "Kannotate", "Kdeclare", "Kcontext", "Kitem", "Kvariable",
69+
"STRING", "ESC", "UNICODE", "HEX", "ArgumentPlaceholder", "NullLiteral",
70+
"Literal", "NumericLiteral", "IntegerLiteral", "DecimalLiteral", "DoubleLiteral",
71+
"Digits", "WS", "NCName", "NameStartChar", "NameChar", "XQComment", "ContentChar"
72+
};
73+
}
74+
public static final String[] ruleNames = makeRuleNames();
7275

73-
private static final String[] _LITERAL_NAMES = {
74-
null, "';'", "'module'", "'namespace'", "'='", "'ordering'", "'ordered'",
75-
"'decimal-format'", "':'", "'decimal-separator'", "'grouping-separator'",
76-
"'infinity'", "'minus-sign'", "'NaN'", "'percent'", "'per-mille'", "'zero-digit'",
77-
"'digit'", "'pattern-separator'", "'import'", "','", "':='", "'external'",
78-
"'function'", "'('", "')'", "'{'", "'}'", "'jsound'", "'compact'", "'verbose'",
79-
"'json'", "'schema'", "'$'", "'|'", "'*'", "'eq'", "'ne'", "'lt'", "'le'",
80-
"'gt'", "'ge'", "'!='", "'<'", "'<='", "'>'", "'>='", "'||'", "'+'", "'-'",
81-
"'div'", "'idiv'", "'mod'", "'!'", "'['", "']'", "'.'", "'$$'", "'#'",
82-
"'{|'", "'|}'", "'for'", "'let'", "'where'", "'group'", "'by'", "'order'",
83-
"'return'", "'if'", "'in'", "'as'", "'at'", "'allowing'", "'empty'", "'count'",
84-
"'stable'", "'ascending'", "'descending'", "'some'", "'every'", "'satisfies'",
85-
"'collation'", "'greatest'", "'least'", "'switch'", "'case'", "'try'",
86-
"'catch'", "'default'", "'then'", "'else'", "'typeswitch'", "'or'", "'and'",
87-
"'not'", "'to'", "'instance'", "'of'", "'statically'", "'is'", "'treat'",
88-
"'cast'", "'castable'", "'version'", "'jsoniq'", "'unordered'", "'true'",
89-
"'false'", "'type'", "'validate'", "'annotate'", "'declare'", "'context'",
90-
"'item'", "'variable'", null, "'?'", "'null'"
91-
};
92-
private static final String[] _SYMBOLIC_NAMES = {
93-
null, null, null, null, null, null, null, null, null, null, null, null,
94-
null, null, null, null, null, null, null, null, null, null, null, null,
95-
null, null, null, null, null, null, null, null, null, null, null, null,
96-
null, null, null, null, null, null, null, null, null, null, null, null,
97-
null, null, null, null, null, null, null, null, null, null, null, null,
98-
null, "Kfor", "Klet", "Kwhere", "Kgroup", "Kby", "Korder", "Kreturn",
99-
"Kif", "Kin", "Kas", "Kat", "Kallowing", "Kempty", "Kcount", "Kstable",
100-
"Kascending", "Kdescending", "Ksome", "Kevery", "Ksatisfies", "Kcollation",
101-
"Kgreatest", "Kleast", "Kswitch", "Kcase", "Ktry", "Kcatch", "Kdefault",
102-
"Kthen", "Kelse", "Ktypeswitch", "Kor", "Kand", "Knot", "Kto", "Kinstance",
103-
"Kof", "Kstatically", "Kis", "Ktreat", "Kcast", "Kcastable", "Kversion",
104-
"Kjsoniq", "Kunordered", "Ktrue", "Kfalse", "Ktype", "Kvalidate", "Kannotate",
105-
"Kdeclare", "Kcontext", "Kitem", "Kvariable", "STRING", "ArgumentPlaceholder",
106-
"NullLiteral", "Literal", "NumericLiteral", "IntegerLiteral", "DecimalLiteral",
107-
"DoubleLiteral", "WS", "NCName", "XQComment", "ContentChar"
108-
};
76+
private static String[] makeLiteralNames() {
77+
return new String[] {
78+
null, "';'", "'module'", "'namespace'", "'='", "'ordering'", "'ordered'",
79+
"'decimal-format'", "':'", "'decimal-separator'", "'grouping-separator'",
80+
"'infinity'", "'minus-sign'", "'NaN'", "'percent'", "'per-mille'", "'zero-digit'",
81+
"'digit'", "'pattern-separator'", "'import'", "','", "':='", "'external'",
82+
"'function'", "'('", "')'", "'{'", "'}'", "'jsound'", "'compact'", "'verbose'",
83+
"'json'", "'schema'", "'$'", "'|'", "'*'", "'eq'", "'ne'", "'lt'", "'le'",
84+
"'gt'", "'ge'", "'!='", "'<'", "'<='", "'>'", "'>='", "'||'", "'+'",
85+
"'-'", "'div'", "'idiv'", "'mod'", "'!'", "'['", "']'", "'.'", "'$$'",
86+
"'#'", "'{|'", "'|}'", "'for'", "'let'", "'where'", "'group'", "'by'",
87+
"'order'", "'return'", "'if'", "'in'", "'as'", "'at'", "'allowing'",
88+
"'empty'", "'count'", "'stable'", "'ascending'", "'descending'", "'some'",
89+
"'every'", "'satisfies'", "'collation'", "'greatest'", "'least'", "'switch'",
90+
"'case'", "'try'", "'catch'", "'default'", "'then'", "'else'", "'typeswitch'",
91+
"'or'", "'and'", "'not'", "'to'", "'instance'", "'of'", "'statically'",
92+
"'is'", "'treat'", "'cast'", "'castable'", "'version'", "'jsoniq'", "'unordered'",
93+
"'true'", "'false'", "'type'", "'validate'", "'annotate'", "'declare'",
94+
"'context'", "'item'", "'variable'", null, "'?'", "'null'"
95+
};
96+
}
97+
private static final String[] _LITERAL_NAMES = makeLiteralNames();
98+
private static String[] makeSymbolicNames() {
99+
return new String[] {
100+
null, null, null, null, null, null, null, null, null, null, null, null,
101+
null, null, null, null, null, null, null, null, null, null, null, null,
102+
null, null, null, null, null, null, null, null, null, null, null, null,
103+
null, null, null, null, null, null, null, null, null, null, null, null,
104+
null, null, null, null, null, null, null, null, null, null, null, null,
105+
null, "Kfor", "Klet", "Kwhere", "Kgroup", "Kby", "Korder", "Kreturn",
106+
"Kif", "Kin", "Kas", "Kat", "Kallowing", "Kempty", "Kcount", "Kstable",
107+
"Kascending", "Kdescending", "Ksome", "Kevery", "Ksatisfies", "Kcollation",
108+
"Kgreatest", "Kleast", "Kswitch", "Kcase", "Ktry", "Kcatch", "Kdefault",
109+
"Kthen", "Kelse", "Ktypeswitch", "Kor", "Kand", "Knot", "Kto", "Kinstance",
110+
"Kof", "Kstatically", "Kis", "Ktreat", "Kcast", "Kcastable", "Kversion",
111+
"Kjsoniq", "Kunordered", "Ktrue", "Kfalse", "Ktype", "Kvalidate", "Kannotate",
112+
"Kdeclare", "Kcontext", "Kitem", "Kvariable", "STRING", "ArgumentPlaceholder",
113+
"NullLiteral", "Literal", "NumericLiteral", "IntegerLiteral", "DecimalLiteral",
114+
"DoubleLiteral", "WS", "NCName", "XQComment", "ContentChar"
115+
};
116+
}
117+
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
109118
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
110119

111120
/**

0 commit comments

Comments
 (0)