question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Create view failed

See original GitHub issue

Describe the bug Create view failed with error: “failed to init view stmt”

To Reproduce create a view with some complex select stmt such as union and join and group by.

Why This is because the toSql() method of SlotRef will return like “<slot 20> col as alias”, if that SlotRef is analyzed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
no7dwcommented, Jul 15, 2022

work around : add select * from between crate view xxx and xx union all yy example

create view gaia_data__gaia.bsc_transactio_view_wade_2 as  
select 
*  
from(
SELECT   
hash,  block_timestamp ,  from_address , to_address , value 
FROM gaia_data__gaia.bsc_transactions where block_timestamp > '2022-03-30' order by block_timestamp desc   limit  10, 50
union all
SELECT   
hash,  block_timestamp ,   from_address , to_address , value 
FROM gaia_data__gaia.bsc_transactions where block_timestamp > '2022-03-30' order by block_timestamp desc   limit  10  
)   bsc_u
0reactions
no7dwcommented, Jul 12, 2022

yep , I know. thanks. but the purpose for my scenario is to create a view for user to query

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] Create view failed · Issue #4839 · apache/doris - GitHub
Describe the bug Create view failed with error: "failed to init view stmt" To Reproduce create a view with some complex select stmt...
Read more >
Applying Update Error CREATE VIEW ...
Applying Update Error CREATE VIEW PS_SCD_TOPN_SUP_VW Failed With ORA-00904: "SCD_VNDSEL_TM_FRM": Invalid Id (Doc ID 2667000.1).
Read more >
Cannot SHOW CREATE VIEW if underlying tabels are ALTERed
Description: If an underlying table changes SHOW CREATE VIEW is broken in 5.1 and 5.5 - but not in 5.0 This ia a...
Read more >
SHOW CREATE VIEW fails for owner - Cloudera Community
We're strugling with the issue that Impala does not provide access to SHOW CREATE VIEW statement for the owner of the view (as...
Read more >
Possible bug in Create database view tool - Esri Community
Failed to execute (CreateDatabaseView). I can successfully connect to the Enterprise Geodatabase in ArcMap and create other views using the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found