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

[SPARK-46478][SQL] Revert SPARK-43049 to use oracle varchar(255) for string #44442

Closed
wants to merge 4 commits into from

Conversation

yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Dec 21, 2023

What changes were proposed in this pull request?

Revert SPARK-43049 to use Oracle Varchar (255) for string for performance consideration

Why are the changes needed?

for performance consideration

Does this PR introduce any user-facing change?

yes, storing strings in Oracle table, which is defined by spark DDL with string columns. Users will get an error if string values exceed 255

org.apache.spark.SparkRuntimeException: [EXCEED_LIMIT_LENGTH] Exceeds char/varchar type length limitation: 255. SQLSTATE: 54006
[info]   at org.apache.spark.sql.errors.QueryExecutionErrors$.exceedMaxLimit(QueryExecutionErrors.scala:2512)

How was this patch tested?

revised unit tests

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

no

Closes #44452

@github-actions github-actions bot added the SQL label Dec 21, 2023
@HyukjinKwon
Copy link
Member

cc @cloud-fan @sadikovi

@sadikovi
Copy link
Contributor

I will close my PR #44452.

FYI: This one appears to be a logical revert, not the actual commit revert.

@sadikovi
Copy link
Contributor

sadikovi commented Dec 22, 2023

@HyukjinKwon I think it would be good to combine my PR description with this one to give a bit more context.

@@ -88,6 +89,11 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTes
s"jdbc:oracle:thin:system/$oracle_password@//$ip:$port/freepdb1"
}

override val defaultMetadata = new MetadataBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The superclass tests with strings. As we use varchar to map string values for Oracle, it's now a special case.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@dongjoon-hyun
Copy link
Member

Merged to master.

Could you make a backport PR for branch-3.5, @yaooqinn ?

@yaooqinn
Copy link
Member Author

Thank you, @dongjoon-hyun.

I'm OOO now. I will raise a backport PR tomorrow.

yaooqinn added a commit to yaooqinn/spark that referenced this pull request Dec 26, 2023
…string

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

Revert SPARK-43049 to use Oracle Varchar (255) for string for performance consideration

### Why are the changes needed?

for performance consideration

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

yes, storing strings in Oracle table, which is defined by spark DDL with string columns. Users will get an error if string values exceed 255

```java
org.apache.spark.SparkRuntimeException: [EXCEED_LIMIT_LENGTH] Exceeds char/varchar type length limitation: 255. SQLSTATE: 54006
[info]   at org.apache.spark.sql.errors.QueryExecutionErrors$.exceedMaxLimit(QueryExecutionErrors.scala:2512)
```

### How was this patch tested?

revised unit tests

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

no

Closes apache#44452

Closes apache#44442 from yaooqinn/SPARK-46478.

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants