You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Paul Rogers (Code Review)" <ge...@cloudera.org> on 2018/12/01 03:40:05 UTC
[Impala-ASF-CR] IMPALA-7907: Fix ScalarFunction.toSql()
Paul Rogers has uploaded a new patch set (#2). ( http://gerrit.cloudera.org:8080/12014 )
Change subject: IMPALA-7907: Fix ScalarFunction.toSql()
......................................................................
IMPALA-7907: Fix ScalarFunction.toSql()
Each AST statement node has a toSql() implementation. The code for
ScalarFunction and ToSqlUtils has a number of issues:
* If Location or Symbol are not set, they are shown as 'null'. Better to
omit these clauses if the items are not available. This is mostly an
issue during testing.
* The generated SQL does not follow the CREATE TABLE syntax. For
example, the signature and return value are provided for Java
functions, but should not be.
* Unlike other statements, this one is generated with a trailing newline.
* ToSql.getCreateFunctionSql() fails to separate functions with the
semi-colon statement separator.
These are all minor issues, but we might as well fix the code to work as
intended.
Testing:
* Added a new unit tests to verify the behavior (no tested existed
previously.)
* Re-ran all FE tests.
Change-Id: Id34d6df97760a11c299092dff8edbdb7033bce1c
---
M fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
M fe/src/main/java/org/apache/impala/catalog/AggregateFunction.java
M fe/src/main/java/org/apache/impala/catalog/Function.java
M fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java
M fe/src/test/java/org/apache/impala/analysis/ToSqlUtilsTest.java
M testdata/workloads/functional-query/queries/QueryTest/functions-ddl.test
M tests/common/test_result_verifier.py
M tests/metadata/test_ddl.py
8 files changed, 214 insertions(+), 39 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/14/12014/2
--
To view, visit http://gerrit.cloudera.org:8080/12014
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id34d6df97760a11c299092dff8edbdb7033bce1c
Gerrit-Change-Number: 12014
Gerrit-PatchSet: 2
Gerrit-Owner: Paul Rogers <pa...@yahoo.com>