You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/07/28 13:10:00 UTC

[jira] [Commented] (IMPALA-11354) load_data.py can't force reload views

    [ https://issues.apache.org/jira/browse/IMPALA-11354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17572447#comment-17572447 ] 

ASF subversion and git services commented on IMPALA-11354:
----------------------------------------------------------

Commit 74fcacc17bc8aefd824babc45eb8093d3ae2698e in impala's branch refs/heads/master from stiga-huang
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=74fcacc17 ]

IMPALA-11354: Fix load_data.py can't force reload views

When force reloading a test table, we drop it before recreate it. We do
the same for views. However, the DROP statement is "DROP TABLE ..."
which can't be executed on views. This causes the view not actually
dropped and the new view is not created as a consequence. The view
remains unchanged.

This patch fixes generate-schema-statements.py to generate DROP VIEW
statement when force reloading views.

Tested locally by force reloading functional.alltypes_view. Verified the
statements succeed in the sql log file.

Change-Id: I0501fe134b83a19ff09d83bc8d87fdeded860244
Reviewed-on: http://gerrit.cloudera.org:8080/18666
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> load_data.py can't force reload views
> -------------------------------------
>
>                 Key: IMPALA-11354
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11354
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Infrastructure
>            Reporter: Quanlong Huang
>            Assignee: Quanlong Huang
>            Priority: Major
>
> I modified the definition of functional.alltypes_view in testdata/datasets/functional/functional_schema_template.sql to add a comment on it. Then I used load_data.py to recreate (force reload) the view:
> {code:bash}
> bin/load-data.py -f -e core -w functional-query --table_formats=text/none --table_names=alltypes_view
> {code}
> The command succeeds but the view doesn't change. Looking into the log file (logs/data_loading/sql/functional/create-functional-query-core-impala-generated-text-none-none.sql.log), the reason is that the previous DROP statement doesn't take effect so the following CREATE VIEW IF NOT EXISTS doesn't take effect either.
> {noformat}
> CREATE DATABASE IF NOT EXISTS functional
> Summary: Returned 1 rows
> Success: True
> Took: 0.059229850769(s)
> Data:
> Database already exists.
> DROP TABLE IF EXISTS functional.alltypes_view
> Summary: Returned 1 rows
> Success: True
> Took: 0.00394201278687(s)
> Data:
> Drop table is not allowed on a view.
> CREATE VIEW IF NOT EXISTS functional.alltypes_view
> COMMENT 'View on alltypes'
> AS SELECT * FROM functional.alltypes
> Summary: Returned 1 rows
> Success: True
> Took: 0.0564069747925(s)
> Data:
> View already exists.
> {noformat}
> We should use DROP VIEW instead of DROP TABLE when force reloading a view.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org