[jira] [Updated] (SPARK-20798) GenerateUnsafeProjection should check if value is null before calling the getter

2017-05-18 Thread Ala Luszczak (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-20798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ala Luszczak updated SPARK-20798:
-
Description: 
GenerateUnsafeProjection.writeStructToBuffer() does not honor the assumption 
that one should first make sure the value is not null before calling the 
getter. This can lead to errors.

An example of generated code:
{noformat}
/* 059 */ final UTF8String fieldName = value.getUTF8String(0);
/* 060 */ if (value.isNullAt(0)) {
/* 061 */   rowWriter1.setNullAt(0);
/* 062 */ } else {
/* 063 */   rowWriter1.write(0, fieldName);
/* 064 */ }
{noformat}


  was:
GenerateUnsafeProjection.writeStructToBuffer() does not honor the assumption 
that one should first make sure the value is not null before calling the getter.

An example of generated code:
{noformat}
/* 059 */ final UTF8String fieldName = value.getUTF8String(0);
/* 060 */ if (value.isNullAt(0)) {
/* 061 */   rowWriter1.setNullAt(0);
/* 062 */ } else {
/* 063 */   rowWriter1.write(0, fieldName);
/* 064 */ }
{noformat}



> GenerateUnsafeProjection should check if value is null before calling the 
> getter
> 
>
> Key: SPARK-20798
> URL: https://issues.apache.org/jira/browse/SPARK-20798
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.2.0
>Reporter: Ala Luszczak
>
> GenerateUnsafeProjection.writeStructToBuffer() does not honor the assumption 
> that one should first make sure the value is not null before calling the 
> getter. This can lead to errors.
> An example of generated code:
> {noformat}
> /* 059 */ final UTF8String fieldName = value.getUTF8String(0);
> /* 060 */ if (value.isNullAt(0)) {
> /* 061 */   rowWriter1.setNullAt(0);
> /* 062 */ } else {
> /* 063 */   rowWriter1.write(0, fieldName);
> /* 064 */ }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Updated] (SPARK-20798) GenerateUnsafeProjection should check if value is null before calling the getter

2017-05-18 Thread Ala Luszczak (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-20798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ala Luszczak updated SPARK-20798:
-
Description: 
GenerateUnsafeProjection.writeStructToBuffer() does not honor the assumption 
that one should first make sure the value is not null before calling the getter.

An example of generated code:
{noformat}
/* 059 */ final UTF8String fieldName = value.getUTF8String(0);
/* 060 */ if (value.isNullAt(0)) {
/* 061 */   rowWriter1.setNullAt(0);
/* 062 */ } else {
/* 063 */   rowWriter1.write(0, fieldName);
/* 064 */ }
{noformat}


> GenerateUnsafeProjection should check if value is null before calling the 
> getter
> 
>
> Key: SPARK-20798
> URL: https://issues.apache.org/jira/browse/SPARK-20798
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.2.0
>Reporter: Ala Luszczak
>
> GenerateUnsafeProjection.writeStructToBuffer() does not honor the assumption 
> that one should first make sure the value is not null before calling the 
> getter.
> An example of generated code:
> {noformat}
> /* 059 */ final UTF8String fieldName = value.getUTF8String(0);
> /* 060 */ if (value.isNullAt(0)) {
> /* 061 */   rowWriter1.setNullAt(0);
> /* 062 */ } else {
> /* 063 */   rowWriter1.write(0, fieldName);
> /* 064 */ }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org