5
我有紅移表所有VARCHAR處理標準listings
表(由於加載到數據庫)在Amazon Redshift中添加LIMIT修復「無效數字,值N」錯誤。爲什麼?
這個查詢(簡體)給我的錯誤:
with AL as (
select
L.price::int as price,
from listings L
where L.price <> 'NULL'
and L.listing_type <> 'NULL'
)
select price from AL
where price < 800
和錯誤:
-----------------------------------------------
error: Invalid digit, Value 'N', Pos 0, Type: Integer
code: 1207
context: NULL
query: 2422868
location: :0
process: query0_24 [pid=0]
-----------------------------------------------
如果我刪除where price < 800
條件,查詢返回就好了......但我需要where條件在那裏。
我也檢查了price
字段的數字有效性,並且都很好看。
玩過後,這實際上使它工作,我不能解釋爲什麼。
with AL as (
select
L.price::int as price,
from listings L
where L.price <> 'NULL'
and L.listing_type <> 'NULL'
limit 10000000000
)
select price from AL
where price < 800
注意到,該表具有比限制規定的數量少得多的記錄。
任何人(可能來自Redshift工程師團隊)解釋爲什麼這是它的方式?可能與查詢計劃如何執行和並行化有關?
將是非常高興看到這個問題的答案! – ingrid