Skip to content

Commit

Permalink
[SPARK-46592][DOCKER][TESTS][FOLLOWUP] Add newline to ORACLE Docker p…
Browse files Browse the repository at this point in the history
…reparation sql

### What changes were proposed in this pull request?

`semicolon` is not able to break SQLs in a file into separated statements

### Why are the changes needed?

a followup for SPARK-46592

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

Check the Oracle docker log

####  Before

```
STDOUT: CONTAINER: running /docker-entrypoint-initdb.d/install.sql ...
STDOUT: ALTER SESSION SET DDL_LOCK_TIMEOUT = 30;ALTER USER SYSTEM IDENTIFIED BY "Th1s1sThe0racle#Pass"
STDOUT: *
STDOUT: ERROR at line 1:
STDOUT: ORA-00922: missing or invalid option
STDOUT: Help: https://docs.oracle.com/error-help/db/ora-00922/
```

#### After
```
STDOUT: CONTAINER: DONE: running /docker-entrypoint-initdb.d/install.sql

STDOUT: Session altered.

STDOUT: User altered.

```

### Was this patch authored or co-authored using generative AI tooling?

no

Closes #44609 from yaooqinn/SPARK-46592-F.

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
  • Loading branch information
yaooqinn authored and MaxGekk committed Jan 5, 2024
1 parent a98c885 commit 70b90c8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class OracleDatabaseOnDocker extends DatabaseOnDocker with Logging {
// means that the lock will no wait. We set the timeout to 30 seconds to try again.
// TODO: This workaround should be removed once the issue is fixed in the image.
// https://github.com/gvenzl/oci-oracle-free/issues/35
writer.write("ALTER SESSION SET DDL_LOCK_TIMEOUT = 30;")
writer.write("ALTER SESSION SET DDL_LOCK_TIMEOUT = 30;\n")
writer.write(s"""ALTER USER SYSTEM IDENTIFIED BY "$oracle_password";""")
writer.close()
val newBind = new Bind(
Expand Down

0 comments on commit 70b90c8

Please sign in to comment.