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