You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/07/26 17:03:07 UTC

[GitHub] [calcite] rubenada opened a new pull request #2083: [CALCITE-4139] Prevent NPE in ListTransientTable

rubenada opened a new pull request #2083:
URL: https://github.com/apache/calcite/pull/2083


   ListTransientTable#scan returns an enumerator that can potentially lead to NPE. Code should be fixed to prevent this from happening.


----------------------------------------------------------------
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



[GitHub] [calcite] danny0405 commented on a change in pull request #2083: [CALCITE-4139] Prevent NPE in ListTransientTable

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #2083:
URL: https://github.com/apache/calcite/pull/2083#discussion_r460685422



##########
File path: core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java
##########
@@ -99,6 +99,9 @@ public ListTransientTable(String name, RelDataType rowType) {
           // TODO cleaner way to handle non-array objects?
           @Override public Object[] current() {
             Object current = list.get(i);
+            if (current == null) {
+              return null;
+            }

Review comment:
       Hmm, is it possible to write a test case there, for your case `null involved repeatUnion`




----------------------------------------------------------------
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



[GitHub] [calcite] rubenada commented on a change in pull request #2083: [CALCITE-4139] Prevent NPE in ListTransientTable

Posted by GitBox <gi...@apache.org>.
rubenada commented on a change in pull request #2083:
URL: https://github.com/apache/calcite/pull/2083#discussion_r460677678



##########
File path: core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java
##########
@@ -99,6 +99,9 @@ public ListTransientTable(String name, RelDataType rowType) {
           // TODO cleaner way to handle non-array objects?
           @Override public Object[] current() {
             Object current = list.get(i);
+            if (current == null) {
+              return null;
+            }

Review comment:
       ListTransientTable is currently used in combination with repeatUnion to support recursive queries. So we could get to this scenario if we have a null involved in the repeatUnion.




----------------------------------------------------------------
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



[GitHub] [calcite] rubenada merged pull request #2083: [CALCITE-4139] Prevent NPE in ListTransientTable

Posted by GitBox <gi...@apache.org>.
rubenada merged pull request #2083:
URL: https://github.com/apache/calcite/pull/2083


   


----------------------------------------------------------------
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



[GitHub] [calcite] danny0405 commented on a change in pull request #2083: [CALCITE-4139] Prevent NPE in ListTransientTable

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #2083:
URL: https://github.com/apache/calcite/pull/2083#discussion_r460610231



##########
File path: core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java
##########
@@ -99,6 +99,9 @@ public ListTransientTable(String name, RelDataType rowType) {
           // TODO cleaner way to handle non-array objects?
           @Override public Object[] current() {
             Object current = list.get(i);
+            if (current == null) {
+              return null;
+            }

Review comment:
       When the `current` can be null ?




----------------------------------------------------------------
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