Karl R
02/27/2026, 4:24 PMDROP VIEW.
It looks like it's somehow no properly cleaning the view from StarRocks memory. I'm running the following operations:
SELECT * FROM myview; OK
DROP VIEW myview; OK
SELECT * FROM myview; PROBLEM: I'm able to read data here.
DROP VIEW myview; ERROR: Doesn't exist
SELECT * FROM myview; PROBLEM: Still able to read data here.
Currently on StarRocks version:
current_version()|
-----------------+
3.4.8-d507a53 |
Can you elaborate on what could be causing this and provide guidance on how to solve this problem?Rocky
02/27/2026, 4:24 PMDROP VIEW is specifically for logical views. If you created an Asynchronous Materialized View, it acts like a table but is managed differently.
* The Symptom: If you have an MV named myview, running DROP VIEW myview might return "OK" if a logical view of that name existed, but the MV itself would remain.
* The Test: Run the following:
sql
SHOW MATERIALIZED VIEWS LIKE 'myview';
* The Fix: If it appears in the list, you must use:
sql
DROP MATERIALIZED VIEW myview;
2. Bypass the Result Cache
StarRocks has a Result Cache and a Query Cache. If these are enabled, the FE or BE might be returning the cached results of your SELECT * query without even checking if the underlying view still exists in the metadata.
* The Test: Run the query with a slight modification to bypass the cache, or explicitly disable the cache in your session:
sql
SET enable_result_cache = false;
SET enable_query_cache = false;
SELECT * FROM myview;
* If the query now fails with "Table/View does not exist," then the issue was simply a stale cache.
3. Verify the Object Type
It is possible (though rare) that there is a name collision or the object is actually a table.
* The Test: Run these commands and check which one returns a result:
sql
SHOW CREATE VIEW myview;
SHOW CREATE TABLE myview;
If SHOW CREATE TABLE returns a result but SHOW CREATE VIEW fails, then myview is actually a table (or an MV), and DROP VIEW will not affect it.
4. Check for FE Metadata Lag
If you are running StarRocks in a high-availability (HA) cluster with multiple Frontends (one Leader, multiple Followers) and a Load Balancer:
* The DROP VIEW command is handled by the Leader FE.
* If your SELECT query is being sent to a Follower FE, there might be a slight lag in replaying the metadata log, or the Follower's metadata might be out of sync.
* The Test: Connect directly to the Leader FE (you can find it via SHOW FRONTENDS;) and run the SELECT. If it fails there but works on Followers, you have a metadata synchronization issue.
5. Force a Metadata Reload (Admin only)
If you've confirmed it's not an MV and caching is disabled, but the view still persists in a "ghost" state, you can try to trigger a metadata refresh:
sql
-- This is a last resort to see if the FE can re-validate its state
INVALIDATE METADATA;
Recommendation:
Start by running SHOW FULL TABLES LIKE 'myview';. The Table_type column will tell you exactly what StarRocks thinks myview is (BASE TABLE, VIEW, or MATERIALIZED VIEW). If it says BASE TABLE or MATERIALIZED VIEW, DROP VIEW is the wrong command.Karl R
02/27/2026, 4:26 PMmyview is a view:
myview |VIEW |Rocky
02/27/2026, 4:28 PMmyview is a View.
In StarRocks, when you run the command SHOW FULL TABLES;, the output includes a column named Table_type.
• A value of VIEW indicates it is a logical view.
• A value of BASE TABLE indicates it is a physical table.
Based on your output snippet myview | VIEW |, StarRocks is identifying it as a view.
If you want to see the SQL definition used to create this view, you can run:
sql
SHOW CREATE VIEW myview;
If you need further details about the view's columns, you can also use:
sql
DESC myview;Karl R
02/27/2026, 4:28 PM5. Force a Metadata Reload (Admin only)
If you've confirmed it's not an MV and caching is disabled, but the view still persists in a "ghost" state, you can try to trigger a metadata refresh:
sql
-- This is a last resort to see if the FE can re-validate its state
INVALIDATE METADATA;Rocky
02/27/2026, 4:29 PMINVALIDATE METADATA is not a supported command (that is typically used in Apache Impala). If you are experiencing a "ghost" state where a view or table persists in the metadata despite being dropped, or if the metadata is out of sync with an external source, here are the correct StarRocks commands to use:
1. For External Catalogs (Hive, Iceberg, Hudi, etc.)
If the metadata issue is related to an external catalog, StarRocks provides specific refresh commands to sync the FE (Frontend) with the remote metastore:
* Refresh an entire catalog:
sql
REFRESH CATALOG <catalog_name>;
* Refresh a specific database:
sql
REFRESH DATABASE <catalog_name>.<db_name>;
* Refresh a specific table:
sql
REFRESH TABLE <catalog_name>.<db_name>.<table_name>;
2. For Materialized Views (MVs)
If the "ghost" state relates to an asynchronous Materialized View that isn't reflecting the latest data or state:
sql
REFRESH MATERIALIZED VIEW <mv_name>;
_Note: If an MV is stuck in a "locked" or "refreshing" state, you may need to check SHOW MATERIALIZED VIEWS and potentially look at the task runs via SELECT _ FROM information_schema.task_runs;.*
3. Clearing Query/Result Caches
Sometimes the "ghost" state isn't in the metadata but in the Result Cache. If you keep seeing old results for a view that you've changed, try disabling the cache for your session to verify:
sql
SET use_query_cache = false;
4. FE Metadata Check (Admin Only)
If you are an administrator and internal metadata truly seems corrupted or "ghosted" (e.g., you can't drop a view because it "doesn't exist," but you can't create it because it "already exists"):
1. Check FE Logs: Look for fe.log or fe.warn.log for any MetaNotFoundException or AlreadyExistsException.
2. Leader Handover: In a multi-FE deployment, sometimes forcing a new Leader to take over can resolve memory-state inconsistencies (though this is rare).
3. Restart FE: As a last resort, restarting the Leader FE node will force it to reload the image and edit logs from disk, which usually clears any transient "ghost" states in memory.
Summary:
If you were trying to use INVALIDATE METADATA to fix a sync issue with an external data lake, use REFRESH CATALOG instead!Srihith Garlapati
03/02/2026, 10:32 PMDROP saying "doesn't exist". This real issue is that your SELECT is resolving the view from an old source.
It could be one of the following causes:
1. Multi-FE metadata sync delay: DDL runs on the FE leader and replicates to followers via EditLog
a. If your client is load-balanced across FEs, the DROP hits the leader but subsquent SELECTs may route to a follower that hasn't replayed it yet
b. So, the DROP succeeds on the leader, SELECT still works on stale follower, and the second DROP fails on leader (which is gone), SELECT still works on the stale follower.
2. Query cache serving stale results:
a. If enable_query_cache is on, a cached result from the first SELECT could be returned without re-resolving view metadata.
b. To diagnose, run these and share the output:
i. SHOW FRONTENDS; SHOW VARIABLES LIKE '%cache%';
ii. Then test this in a single session without reconnecting:
1. DROP VIEW myview; and SELECT * FROM myview;
So if the single-session test fails as expected, the issue is multi-FE routing basically your connection pool or proxy is sending statements to different FEs.
Try connecting directly to the FE leader IP from SHOW FRONTENDS; or disable query cache: SET enable_query_cache = false; SET query_cache_type = 0; and re-test.