【hive sql】由於with table_name as()造成EOF錯誤

今天查數據的時候發現這樣一個錯誤:

cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in XXXXXXX

這個錯誤其實還挺常見的,經常出現於

select *
from (
    select *
    from table_A
) as table_B

如果 ‘as table_B’ 不加的話會報這個錯誤。

今天的情況是:

with table_B as(
    select *
    from (
        select *
        from table_A
    ) 
)

如果單獨把這些複製在hue裏查詢是會報EOF錯的,需要對table_B進行使用。也就是如下:

with table_B as(
    select *
    from (
        select *
        from table_A
    ) 
)

select *
from table_B

需要對table_B進行使用,這樣纔不會報錯。

雖然不太理解,但是記錄一下。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章