You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Bikramjeet Vig (Code Review)" <ge...@cloudera.org> on 2018/10/30 22:19:31 UTC

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Bikramjeet Vig has uploaded this change for review. ( http://gerrit.cloudera.org:8080/11830


Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................

IMPALA-2566: Remove ability to access impala builtin cast functions
directly

Currently, all impala builtin cast functions are exposed to the user
and can be used directly in sql statements. These methods are used
internally for casting and sometimes require context not available
when used directly. This patch removes direct access to those methods
by throwing an analysis exception.

Testing:
Added relevant frontend tests.

Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
---
M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
2 files changed, 26 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/30/11830/1
-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 1
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Bikramjeet Vig (Code Review)" <ge...@cloudera.org>.
Bikramjeet Vig has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 3: Code-Review+2

carrying over +2


-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 3
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 23:10:20 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 4: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 4
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 23:11:47 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 4:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/3394/ DRY_RUN=false


-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 4
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 23:11:48 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java:

http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java@3962
PS1, Line 3962:     String expectedError = "Impala builtin cast functions as reserved for internal use only";
line too long (93 > 90)



-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 1
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Tue, 30 Oct 2018 22:20:30 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 4: Verified+1


-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 4
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Thu, 01 Nov 2018 03:02:13 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Bikramjeet Vig (Code Review)" <ge...@cloudera.org>.
Hello Tianyi Wang, Tim Armstrong, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/11830

to look at the new patch set (#3).

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................

IMPALA-2566: Remove ability to access impala builtin cast functions
directly

Currently, all impala builtin cast functions are exposed to the user
and can be used directly in sql statements. These methods are used
internally for casting and sometimes require context not available
when used directly. This patch removes direct access to those methods
by throwing an analysis exception.

Testing:
Added relevant frontend tests.

Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
---
M fe/src/main/java/org/apache/impala/analysis/CastExpr.java
M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
3 files changed, 43 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/30/11830/3
-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 3
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Bikramjeet Vig (Code Review)" <ge...@cloudera.org>.
Bikramjeet Vig has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
File fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java:

http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java@500
PS1, Line 500: Impala builtin cast functions as reserved for internal use only
Open to suggestions for a error message



-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 1
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Comment-Date: Tue, 30 Oct 2018 22:20:15 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 2: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11830/2/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
File fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java:

http://gerrit.cloudera.org:8080/#/c/11830/2/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java@184
PS2, Line 184:   private boolean isBuiltinCastFunction(){
space before {



-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 2
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 22:43:33 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Bikramjeet Vig (Code Review)" <ge...@cloudera.org>.
Bikramjeet Vig has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/11830/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/11830/1//COMMIT_MSG@15
PS1, Line 15: 
> It's weird that we're still showing all these functions in _impala_builtins
As discussed offline, we are going ahead with this solution due the extent of invasive changes required for the alternatives.


http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
File fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java:

http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java@500
PS1, Line 500: Impala builtin cast functions as reserved for internal use only
> Maybe something like:
Done


http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java:

http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java@3962
PS1, Line 3962:     String expectedError = "Impala builtin cast functions as reserved for internal use only";
> line too long (93 > 90)
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 1
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 22:32:32 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/1219/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 1
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Tue, 30 Oct 2018 22:58:04 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 3:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/1240/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 3
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 23:31:53 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Bikramjeet Vig (Code Review)" <ge...@cloudera.org>.
Bikramjeet Vig has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11830/2/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
File fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java:

http://gerrit.cloudera.org:8080/#/c/11830/2/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java@184
PS2, Line 184:   private boolean isBuiltinCastFunction(){
> space before {
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 2
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 23:09:20 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Bikramjeet Vig (Code Review)" <ge...@cloudera.org>.
Hello Tianyi Wang, Tim Armstrong, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/11830

to look at the new patch set (#2).

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................

IMPALA-2566: Remove ability to access impala builtin cast functions
directly

Currently, all impala builtin cast functions are exposed to the user
and can be used directly in sql statements. These methods are used
internally for casting and sometimes require context not available
when used directly. This patch removes direct access to those methods
by throwing an analysis exception.

Testing:
Added relevant frontend tests.

Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
---
M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
2 files changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/30/11830/2
-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 2
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................

IMPALA-2566: Remove ability to access impala builtin cast functions
directly

Currently, all impala builtin cast functions are exposed to the user
and can be used directly in sql statements. These methods are used
internally for casting and sometimes require context not available
when used directly. This patch removes direct access to those methods
by throwing an analysis exception.

Testing:
Added relevant frontend tests.

Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Reviewed-on: http://gerrit.cloudera.org:8080/11830
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M fe/src/main/java/org/apache/impala/analysis/CastExpr.java
M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
3 files changed, 43 insertions(+), 1 deletion(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 5
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 2:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/1239/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 2
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 23:22:43 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-2566: Remove ability to access impala builtin cast functions directly

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/11830 )

Change subject: IMPALA-2566: Remove ability to access impala builtin cast functions directly
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/11830/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/11830/1//COMMIT_MSG@15
PS1, Line 15: 
It's weird that we're still showing all these functions in _impala_builtins but you can't call any of them. I.e. it doesn't feel like the right way to fix it. 

I get that's probably a more invasive change but it feels like trading one kind of wonkiness for another - maybe it's better just to fix the narrow casttochar() issue for now?

I guess maybe this is easier for now than adding tests for all of the callable casttochar* variants (which would be the right thing to do if we left them in there) but we should file a follow-on to fix the wonkiness at least.


http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
File fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java:

http://gerrit.cloudera.org:8080/#/c/11830/1/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java@500
PS1, Line 500: Impala builtin cast functions as reserved for internal use only
> Open to suggestions for a error message
Maybe something like:

"_the_function() is reserved for internal use only. Use 'cast(expr AS type)' instead."



-- 
To view, visit http://gerrit.cloudera.org:8080/11830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Gerrit-Change-Number: 11830
Gerrit-PatchSet: 1
Gerrit-Owner: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Wed, 31 Oct 2018 01:03:17 +0000
Gerrit-HasComments: Yes