Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
ghx-label-9
Description
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:
bin/load-data.py -f -e core -w functional-query --table_formats=text/none --table_names=alltypes_view
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.
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.
We should use DROP VIEW instead of DROP TABLE when force reloading a view.