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

%jvmoption and parameters containing a space #878

Closed
allipatev opened this issue Apr 30, 2024 · 0 comments
Closed

%jvmoption and parameters containing a space #878

allipatev opened this issue Apr 30, 2024 · 0 comments
Assignees
Labels
bug Unwanted / harmful behavior

Comments

@allipatev
Copy link

JVM parameters containing a space don't seem to be handled properly in Java UDFs:

CREATE OR REPLACE JAVA SCALAR SCRIPT test.jvmoption_test_no_space() EMITS(res VARCHAR(2000000)) AS

%jvmoption -Dhttp.agent="ABC";

class JVMOPTION_TEST_NO_SPACE {
 static void run(ExaMetadata exa, ExaIterator ctx) throws Exception {

	ctx.emit("Success!");
 }
}
/
;
SELECT
	test.jvmoption_test_no_space()
;
RES     |
--------+
Success!|
CREATE OR REPLACE JAVA SCALAR SCRIPT test.jvmoption_test_with_space() EMITS(res VARCHAR(2000000)) AS

%jvmoption -Dhttp.agent="ABC DEF";

class JVMOPTION_TEST_WITH_SPACE {
 static void run(ExaMetadata exa, ExaIterator ctx) throws Exception {

	ctx.emit("Success!");
 }
}
/
;
select
	test.jvmoption_test_with_space()
;
SQL Error [22002]: VM error: F-UDF-CL-LIB-1125: F-UDF-CL-SL-JAVA-1000: F-UDF-CL-SL-JAVA-1028:
Cannot start the JVM:
unknown error (-1)
(Session: 1797761165926793216)

Splitting seems to happen here: https://github.com/exasol/script-languages/blob/7da3e47941f102b372b2f694e08349cb1eae5f01/exaudfclient/base/javacontainer/javacontainer_impl.cc#L491

Tested on 7.1.24 and 8.26.0.

Also, -Dhttp.agent="ABC" works fine when passed to a java executable directly.

As you know, User Agent could be quite free-form, so please consider supporting JVM parameters containing spaces (actually, it might make sense to support all of " \t\f\v" that are used for splitting).

@tkilias tkilias added the bug Unwanted / harmful behavior label May 2, 2024
tomuben added a commit to exasol/script-languages that referenced this issue Jul 25, 2024
@tomuben tomuben self-assigned this Oct 29, 2024
tomuben added a commit to exasol/script-languages that referenced this issue Nov 6, 2024
@tomuben tomuben closed this as completed Nov 6, 2024
tomuben added a commit that referenced this issue Nov 11, 2024
Changelog:
- #878: Fixed jvmoption and parameters containing a space (#1001) 
- #1002: Use ECR fallback repository for Trivy caching (#1004)
tomuben added a commit that referenced this issue Nov 14, 2024
Changelist:

- #944: Removed exaudfclient_bin_py3 (#975) 
- #967: Added ctpg script options parser (#968) 
- #972 and #973: Refactorings for Script Options parser (#976) 
- #977: Fixed Trivy update cache workflow (#978) 
- #969: Use new CTPG parser in java vm (#970) 
- #980: Moved flavor template-Exasol-all-java-17 to script-languages repo (#984)
- #971: Removed dead code in Java VM (#985) 
- Refactorings in ScriptOptions parser (#987) 
- #988: Adapted Java integration tests for new ScriptOptions parser (#995) 
- #997: Added documentation for Rollback of Script-Languages-Container (#999)
- #878: Fixed jvmoption and parameters containing a space (#1001) 
- #1002: Use ECR fallback repository for Trivy caching (#1004) 
- #1006: Updated Dependencies on top of 8.4.0 (#1007) 
- #958: Fix conda version conflict (#1010) 
- #1009: Removed NVIDIA GPU Driver Libraries from template-CUDA SLC (#1012)
- Bumped version to 9.0.0 (#1013) 
- #1014: Fixed Push Docker Test Container workflow (#1015)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
Development

No branches or pull requests

3 participants