You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/06 04:28:28 UTC
[GitHub] [spark] LuciferYang opened a new pull request #31055: [WIP][SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
LuciferYang opened a new pull request #31055:
URL: https://github.com/apache/spark/pull/31055
### What changes were proposed in this pull request?
`MapObjects.doGenCode` method will generate wrong code when `inputDataType` is `ArrayBuffer`, the error generated code part as follow:
```
/* 126 */ private scala.collection.mutable.ArrayBuffer MapObjects_0(InternalRow i) {
/* 127 */ boolean isNull_4 = i.isNullAt(1);
/* 128 */ ArrayData value_4 = isNull_4 ?
/* 129 */ null : (i.getArray(1));
/* 130 */ scala.collection.mutable.ArrayBuffer value_3 = null;
/* 131 */
/* 132 */ if (!isNull_4) {
/* 133 */
/* 134 */ int dataLength_0 = value_4.numElements();
/* 135 */
/* 136 */ scala.Tuple2[] convertedArray_0 = null;
/* 137 */ convertedArray_0 = new scala.Tuple2[dataLength_0];
/* 138 */
/* 139 */
/* 140 */ int loopIndex_0 = 0;
/* 141 */
/* 142 */ while (loopIndex_0 < dataLength_0) {
/* 143 */ value_MapObject_lambda_variable_1 = (InternalRow) (value_4.getStruct(loopIndex_0, 2));
/* 144 */ isNull_MapObject_lambda_variable_1 = value_4.isNullAt(loopIndex_0);
/* 145 */
/* 146 */ boolean isNull_5 = false;
/* 147 */ scala.Tuple2 value_5 = null;
/* 148 */ if (!false && isNull_MapObject_lambda_variable_1) {
/* 149 */
/* 150 */ isNull_5 = true;
/* 151 */ value_5 = ((scala.Tuple2)null);
/* 152 */ } else {
/* 153 */ scala.Tuple2 value_13 = NewInstance_0(i);
/* 154 */ isNull_5 = false;
/* 155 */ value_5 = value_13;
/* 156 */ }
/* 157 */ if (isNull_5) {
/* 158 */ convertedArray_0[loopIndex_0] = null;
/* 159 */ } else {
/* 160 */ convertedArray_0[loopIndex_0] = value_5;
/* 161 */ }
/* 162 */
/* 163 */ loopIndex_0 += 1;
/* 164 */ }
/* 165 */
/* 166 */ value_3 = new org.apache.spark.sql.catalyst.util.GenericArrayData(convertedArray_0);
/* 167 */ }
/* 168 */ globalIsNull_0 = isNull_4;
/* 169 */ return value_3;
/* 170 */ }
```
Line 166 in generated code assign `GenericArrayData` to `value_3(ArrayBuffer)` because `ArrayBuffer` type can't match `s.c.i.Seq` branch in Scala 2.13 in `MapObjects.doGenCode` method now.
So this pr change to use `s.c.Seq` instead of `Seq` alias to let `ArrayBuffer` type can enter the same branch as Scala 2.12.
After this pr the generate code when `inputDataType` is `ArrayBuffer` as follow:
```
/* 126 */ private scala.collection.mutable.ArrayBuffer MapObjects_0(InternalRow i) {
/* 127 */ boolean isNull_4 = i.isNullAt(1);
/* 128 */ ArrayData value_4 = isNull_4 ?
/* 129 */ null : (i.getArray(1));
/* 130 */ scala.collection.mutable.ArrayBuffer value_3 = null;
/* 131 */
/* 132 */ if (!isNull_4) {
/* 133 */
/* 134 */ int dataLength_0 = value_4.numElements();
/* 135 */
/* 136 */ scala.collection.mutable.Builder collectionBuilder_0 = scala.collection.mutable.ArrayBuffer$.MODULE$.newBuilder();
/* 137 */ collectionBuilder_0.sizeHint(dataLength_0);
/* 138 */
/* 139 */
/* 140 */ int loopIndex_0 = 0;
/* 141 */
/* 142 */ while (loopIndex_0 < dataLength_0) {
/* 143 */ value_MapObject_lambda_variable_1 = (InternalRow) (value_4.getStruct(loopIndex_0, 2));
/* 144 */ isNull_MapObject_lambda_variable_1 = value_4.isNullAt(loopIndex_0);
/* 145 */
/* 146 */ boolean isNull_5 = false;
/* 147 */ scala.Tuple2 value_5 = null;
/* 148 */ if (!false && isNull_MapObject_lambda_variable_1) {
/* 149 */
/* 150 */ isNull_5 = true;
/* 151 */ value_5 = ((scala.Tuple2)null);
/* 152 */ } else {
/* 153 */ scala.Tuple2 value_13 = NewInstance_0(i);
/* 154 */ isNull_5 = false;
/* 155 */ value_5 = value_13;
/* 156 */ }
/* 157 */ if (isNull_5) {
/* 158 */ collectionBuilder_0.$plus$eq(null);
/* 159 */ } else {
/* 160 */ collectionBuilder_0.$plus$eq(value_5);
/* 161 */ }
/* 162 */
/* 163 */ loopIndex_0 += 1;
/* 164 */ }
/* 165 */
/* 166 */ value_3 = (scala.collection.mutable.ArrayBuffer) collectionBuilder_0.result();
/* 167 */ }
/* 168 */ globalIsNull_0 = isNull_4;
/* 169 */ return value_3;
/* 170 */ }
```
### Why are the changes needed?
Bug fix in Scala 2.13
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
- Pass the Jenkins or GitHub Action
- Manual test `sql/catalyst` and `sql/core` in Scala 2.13 passed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755195368
**[Test build #133712 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133712/testReport)** for PR 31055 at commit [`438b595`](https://github.com/apache/spark/commit/438b5955af8cff6c396e398edec47ce97d4d86f7).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755110045
Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38300/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755152991
master branch `sql/core` module manual test:
```
mvn clean test -pl sql/core -Pscala-2.13
Run completed in 1 hour, 38 minutes, 14 seconds.
Total number of tests run: 9173
Suites: completed 406, aborted 0
Tests: succeeded 9173, failed 0, canceled 1, ignored 51, pending 0
All tests passed.
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755838854
Yay. Thanks a lot, @LuciferYang .
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755836098
build successfully ~ haha ~
[https://amplab.cs.berkeley.edu/jenkins/job/spark-branch-3.1-test-maven-hadoop-3.2-scala-2.13/118/](https://amplab.cs.berkeley.edu/jenkins/job/spark-branch-3.1-test-maven-hadoop-3.2-scala-2.13/118/)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755207768
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/133712/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755207768
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/133712/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755126290
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38300/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755129054
Merged to master/3.1. Thank you, @LuciferYang and @HyukjinKwon .
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun closed pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #31055:
URL: https://github.com/apache/spark/pull/31055
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755081317
**[Test build #133712 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133712/testReport)** for PR 31055 at commit [`438b595`](https://github.com/apache/spark/commit/438b5955af8cff6c396e398edec47ce97d4d86f7).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31055: [WIP][SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755099070
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38300/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31055: [WIP][SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755081317
**[Test build #133712 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133712/testReport)** for PR 31055 at commit [`438b595`](https://github.com/apache/spark/commit/438b5955af8cff6c396e398edec47ce97d4d86f7).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755130031
Thx ~ @HyukjinKwon @dongjoon-hyun
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31055: [SPARK-33948][SQL] Fix CodeGen error of MapObjects.doGenCode method in Scala 2.13
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31055:
URL: https://github.com/apache/spark/pull/31055#issuecomment-755126290
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38300/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org