Skip to content

Commit

Permalink
Merge pull request #1239 from RumbleDB/NoDFTests
Browse files Browse the repository at this point in the history
No df tests
  • Loading branch information
ghislainfourny authored May 16, 2023
2 parents 42a662d + 173811b commit 53f4df0
Show file tree
Hide file tree
Showing 186 changed files with 804 additions and 705 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: mvn -Dtest=RuntimeTests test
- name: RuntimeTestsNoParallelism
run: mvn -Dtest=RuntimeTestsNoParallelism test
- name: RuntimeTestsNoInlining
run: mvn -Dtest=RuntimeTestsNoInlining test
- name: StaticTypeTests
run: mvn -Dtest=StaticTypeTests test
- name: JavaAPITest
Expand Down Expand Up @@ -70,8 +72,12 @@ jobs:
run: mvn clean compile assembly:single
- name: SparkRuntimeTests
run: mvn -Dtest=SparkRuntimeTests test
- name: NativeFLWORRuntimeTests
run: mvn -Dtest=NativeFLWORRuntimeTests test
- name: SparkRuntimeTestsNativeDeactivated
run: mvn -Dtest=SparkRuntimeTestsNativeDeactivated test
- name: SparkRuntimeTestsDataFramesDeactivated
run: mvn -Dtest=SparkRuntimeTestsDataFramesDeactivated test
- name: SparkRuntimeTestsParallelismDeactivated
run: mvn -Dtest=SparkRuntimeTestsParallelismDeactivated test

tests3:

Expand All @@ -96,11 +102,16 @@ jobs:
run: mvn clean compile assembly:single
- name: Bugs
run: mvn -Dtest=Bugs test
- name: RuntimeTestsNoInlining
run: mvn -Dtest=RuntimeTestsNoInlining test
- name: NativeFLWORRuntimeTests
run: mvn -Dtest=NativeFLWORRuntimeTests test
- name: NativeFLWORRuntimeTestsNativeDeactivated
run: mvn -Dtest=NativeFLWORRuntimeTestsNativeDeactivated test
- name: NativeFLWORRuntimeTestsDataFramesDeactivated
run: mvn -Dtest=NativeFLWORRuntimeTestsDataFramesDeactivated test
- name: NativeFLWORRuntimeTestsParallelismDeactivated
run: mvn -Dtest=NativeFLWORRuntimeTestsParallelismDeactivated test
- name: MLTests
run: mvn -Dtest=MLTests test
- name: MLTestsNativeDeactivated
run: mvn -Dtest=MLTestsNativeDeactivated test

34 changes: 12 additions & 22 deletions src/main/java/org/rumbledb/context/NamedFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public class NamedFunctions implements Serializable, KryoSerializable {

private static final long serialVersionUID = 1L;

// two maps for User defined function are needed as execution mode is known at static analysis phase
// two maps for User defined function are needed as execution mode is known at
// static analysis phase
// but functions items are fully known at runtimeIterator generation
private HashMap<FunctionIdentifier, FunctionItem> userDefinedFunctions;
private RumbleRuntimeConfiguration conf;
Expand Down Expand Up @@ -78,11 +79,7 @@ public RuntimeIterator getUserDefinedFunctionCallIterator(
arguments
);
}
throw new UnknownFunctionCallException(
identifier.getName(),
identifier.getArity(),
metadata
);
throw new UnknownFunctionCallException(identifier.getName(), identifier.getArity(), metadata);

}

Expand Down Expand Up @@ -176,12 +173,7 @@ public static RuntimeIterator getBuiltInFunctionIterator(
throw new UnknownFunctionCallException(identifier.getName(), identifier.getArity(), metadata);
}
for (int i = 0; i < arguments.size(); i++) {
if (
!builtinFunction.getSignature()
.getParameterTypes()
.get(i)
.equals(SequenceType.ITEM_STAR)
) {
if (!builtinFunction.getSignature().getParameterTypes().get(i).equals(SequenceType.ITEM_STAR)) {
SequenceType sequenceType = builtinFunction.getSignature().getParameterTypes().get(i);
RuntimeStaticContext runtimeStaticContext = new RuntimeStaticContext(
conf,
Expand Down Expand Up @@ -218,20 +210,18 @@ public static RuntimeIterator getBuiltInFunctionIterator(
RuntimeIterator functionCallIterator;
try {
Constructor<? extends RuntimeIterator> constructor = builtinFunction.getFunctionIteratorClass()
.getConstructor(
List.class,
RuntimeStaticContext.class
);
.getConstructor(List.class, RuntimeStaticContext.class);
functionCallIterator = constructor.newInstance(
arguments,
new RuntimeStaticContext(conf, builtinFunction.getSignature().getReturnType(), executionMode, metadata)
new RuntimeStaticContext(
conf,
builtinFunction.getSignature().getReturnType(),
executionMode,
metadata
)
);
} catch (ReflectiveOperationException ex) {
RuntimeException e = new UnknownFunctionCallException(
identifier.getName(),
arguments.size(),
metadata
);
RuntimeException e = new UnknownFunctionCallException(identifier.getName(), arguments.size(), metadata);
e.initCause(ex);
throw e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void print(StringBuffer buffer, int indent) {
for (int i = 0; i < indent; ++i) {
buffer.append(" ");
}
buffer.append(getClass().getSimpleName());
buffer.append(getClass().getSimpleName() + " (" + this.identifier + ")");
buffer.append(" | " + this.highestExecutionMode);
buffer.append(
" | "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void print(StringBuffer buffer, int indent) {
buffer.append(" ");
}
buffer.append("Body:\n");
this.body.print(buffer, indent + 2);
this.body.print(buffer, indent + 4);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/rumbledb/items/Base64BinaryItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public Base64BinaryItem() {
}

public Base64BinaryItem(String stringValue) {
this.stringValue = stringValue;
this.value = parseBase64BinaryString(stringValue);
this.stringValue = StringUtils.chomp(Base64.encodeBase64String(this.value));
}

@Override
Expand Down
2 changes: 1 addition & 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.7
// Generated from ./src/main/java/org/rumbledb/parser/Jsoniq.g4 by ANTLR 4.8

// Java header
package org.rumbledb.parser;
Expand Down
125 changes: 67 additions & 58 deletions src/main/java/org/rumbledb/parser/JsoniqLexer.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.7
// Generated from ./src/main/java/org/rumbledb/parser/Jsoniq.g4 by ANTLR 4.8

// Java header
package org.rumbledb.parser;
Expand All @@ -16,7 +16,7 @@

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

protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
Expand Down Expand Up @@ -49,63 +49,72 @@ public class JsoniqLexer extends Lexer {
"DEFAULT_MODE"
};

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

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

/**
Expand Down
Loading

0 comments on commit 53f4df0

Please sign in to comment.