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-30904][SQL] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal #27654

Closed
wants to merge 3 commits into from

Conversation

CJStuart
Copy link
Contributor

@CJStuart CJStuart commented Feb 20, 2020

What changes were proposed in this pull request?

This PR fixes SPARK-30904 by adding a null check.

Why are the changes needed?

For HIVE_CLI_SERVICE_PROTOCOL_V5 and below, serialization fails on NULL-containing decimal columns, caused by a call to value.toPlainString(), where value might be null. This null check fixes it.

Does this PR introduce any user-facing change?

No

How was this patch tested?

A test was added for serialization of NULL decimals for all HIVE_CLI_SERVICE_PROTOCOL versions.

@CJStuart CJStuart changed the title [WIP][SPARK-30904] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal [WIP][SPARK-30904][SQL] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal Feb 20, 2020
@HyukjinKwon
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Feb 21, 2020

Test build #118742 has finished for PR 27654 at commit e1d466b.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@CJStuart CJStuart changed the title [WIP][SPARK-30904][SQL] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal [SPARK-30904][SQL] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal Feb 21, 2020
@CJStuart
Copy link
Contributor Author

@juliuszsompolski

@SparkQA
Copy link

SparkQA commented Feb 21, 2020

Test build #118781 has finished for PR 27654 at commit 5442bf7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Contributor

@juliuszsompolski juliuszsompolski left a comment

Choose a reason for hiding this comment

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

@wangyum wangyum changed the title [SPARK-30904][SQL] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal [SPARK-30904][SQL][test-hive1.2] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal Feb 22, 2020
@wangyum
Copy link
Member

wangyum commented Feb 22, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Feb 22, 2020

Test build #118809 has finished for PR 27654 at commit 5442bf7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum wangyum changed the title [SPARK-30904][SQL][test-hive1.2] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal [SPARK-30904][SQL] Thrift RowBasedSet serialization throws NullPointerException on NULL BigDecimal Feb 22, 2020
@wangyum wangyum closed this in bcce1b1 Feb 22, 2020
wangyum pushed a commit that referenced this pull request Feb 22, 2020
…rException on NULL BigDecimal

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

This PR fixes SPARK-30904 by adding a null check.

### Why are the changes needed?

For HIVE_CLI_SERVICE_PROTOCOL_V5 and below, serialization fails on NULL-containing decimal columns, caused by a call to  `value.toPlainString()`, where `value` might be null. This null check fixes it.

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

No

### How was this patch tested?

A test was added for serialization of NULL decimals for all HIVE_CLI_SERVICE_PROTOCOL versions.

Closes #27654 from CJStuart/SPARK-30904.

Authored-by: Christian Stuart <christian.stuart@databricks.com>
Signed-off-by: Yuming Wang <wgyumg@gmail.com>
(cherry picked from commit bcce1b1)
Signed-off-by: Yuming Wang <wgyumg@gmail.com>
@wangyum
Copy link
Member

wangyum commented Feb 22, 2020

Merged to master and branch-3.0.

sjincho pushed a commit to sjincho/spark that referenced this pull request Apr 15, 2020
…rException on NULL BigDecimal

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

This PR fixes SPARK-30904 by adding a null check.

### Why are the changes needed?

For HIVE_CLI_SERVICE_PROTOCOL_V5 and below, serialization fails on NULL-containing decimal columns, caused by a call to  `value.toPlainString()`, where `value` might be null. This null check fixes it.

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

No

### How was this patch tested?

A test was added for serialization of NULL decimals for all HIVE_CLI_SERVICE_PROTOCOL versions.

Closes apache#27654 from CJStuart/SPARK-30904.

Authored-by: Christian Stuart <christian.stuart@databricks.com>
Signed-off-by: Yuming Wang <wgyumg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants