Skip to content

Commit

Permalink
Refactorings Script Options Parser
Browse files Browse the repository at this point in the history
closes #990: Forward JAR options without changing order to classpath
closes #989: Trim script class and import script options
closes #993: Added escape sequence for backslash in new Script Options parser
closes #986: Added environment variable for new ScriptOptionsLine parser in UDF client
  • Loading branch information
tomuben authored Oct 29, 2024
1 parent 430eb35 commit 4b35f94
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .current_gitmodules

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions doc/changes/changes_8.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ This release uses version 1.0.0 of the container tool.
- #971: Removed dead code in Java VM
- #982: Added a performance test for ScriptOptions parser for a single line UDF
- #983: Refactor CTPG script options Java parser code
- #986: Added environment variable for new ScriptOptionsLine parser in UDF client
- #990: Forward JAR options without changing order to classpath
- #989: Trim script class and import script options

## Bugs
- #977: Fixed Trivy update cache workflow
- #993: Added escape sequence for backslash in new Script Options parser

## Doc

Expand Down
11 changes: 10 additions & 1 deletion exaudfclient/exaudfclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ int main(int argc, char **argv) {
cerr << "Usage: " << argv[0] << " <socket> lang=python|lang=r|lang=java|lang=streaming|lang=benchmark" << endl;
return 1;
}
const char* script_options_parser_env_val = ::getenv("SCRIPT_OPTIONS_PARSER_VERSION");
const bool useCtpgScriptOptionsParser = script_options_parser_env_val != nullptr &&
::strcmp(script_options_parser_env_val, "2") == 0;

#endif

if (::setenv("HOME", "/tmp", 1) == -1)
Expand Down Expand Up @@ -167,7 +171,12 @@ int main(int argc, char **argv) {
} else if (strcmp(argv[2], "lang=java")==0)
{
#ifdef ENABLE_JAVA_VM
vmMaker = [&](){return SWIGVMContainers::JavaContainerBuilder().build();};
if (useCtpgScriptOptionsParser) {
vmMaker = [&](){return SWIGVMContainers::JavaContainerBuilder().useCtpgParser().build();};
} else {
vmMaker = [&](){return SWIGVMContainers::JavaContainerBuilder().build();};
}

#else
throw SWIGVM::exception("this exaudfclient has been compilied without Java support");
#endif
Expand Down
2 changes: 1 addition & 1 deletion script-languages
Submodule script-languages updated 32 files
+12 −12 .github/workflows/check_bazel_tests.yml
+3 −3 exaudfclient/base/javacontainer/javacontainer.cc
+2 −2 exaudfclient/base/javacontainer/javacontainer.h
+7 −8 exaudfclient/base/javacontainer/javacontainer_builder.cc
+1 −1 exaudfclient/base/javacontainer/javacontainer_builder.h
+6 −11 exaudfclient/base/javacontainer/javacontainer_impl.cc
+3 −4 exaudfclient/base/javacontainer/javacontainer_impl.h
+6 −3 exaudfclient/base/javacontainer/script_options/BUILD
+5 −20 exaudfclient/base/javacontainer/script_options/converter.cc
+12 −15 exaudfclient/base/javacontainer/script_options/converter.h
+32 −0 exaudfclient/base/javacontainer/script_options/converter_legacy.cc
+44 −0 exaudfclient/base/javacontainer/script_options/converter_legacy.h
+31 −0 exaudfclient/base/javacontainer/script_options/converter_v2.cc
+43 −0 exaudfclient/base/javacontainer/script_options/converter_v2.h
+35 −25 exaudfclient/base/javacontainer/script_options/extractor.h
+25 −4 exaudfclient/base/javacontainer/script_options/extractor_impl.cc
+48 −0 exaudfclient/base/javacontainer/script_options/extractor_impl.h
+11 −2 exaudfclient/base/javacontainer/script_options/parser_ctpg.cc
+4 −1 exaudfclient/base/javacontainer/script_options/parser_ctpg_script_importer.cc
+78 −0 exaudfclient/base/javacontainer/script_options/string_ops.cc
+43 −0 exaudfclient/base/javacontainer/script_options/string_ops.h
+2 −2 exaudfclient/base/javacontainer/script_options/test/BUILD
+62 −0 exaudfclient/base/javacontainer/script_options/test/converter_test.cc
+59 −0 exaudfclient/base/javacontainer/script_options/test/string_ops_tests.cc
+5 −5 exaudfclient/base/javacontainer/test/BUILD
+19 −0 exaudfclient/base/javacontainer/test/cpp/javacontainer_extractor_v2_test.cc
+141 −1 exaudfclient/base/javacontainer/test/cpp/javacontainer_test.cc
+8 −11 exaudfclient/base/javacontainer/test/cpp/javavm_test.cc
+17 −8 exaudfclient/base/script_options_parser/ctpg/script_option_lines_ctpg.cc
+26 −1 exaudfclient/base/script_options_parser/ctpg/test/script_option_lines_test.cpp
+ exaudfclient/docs/java_script_options_parser.drawio.png
+8 −1 exaudfclient/exaudfclient.cc

0 comments on commit 4b35f94

Please sign in to comment.