2016-06-22 16 views
1

で結果を取得することはできません。インパラのクエリは、私はハイブ/インパラ上で実行し、次のクエリ持っているのNullPointerException

select count(p.id) as tweet_count, p.author as author,p.profile_image_url as profile_image_url,p.screen_name as screen_name, 
concat_ws('/',min(p.postday),min(p.postmonth),min(p.postyear)) as creation_date,p.message message,af.followerid as follower 
from post p 
inner join author_follower af on af.id like if(p.author= null, '', concat(p.author,'%')) 
where p.hashtaglist like 'hashtagtobeused' 
group by author,profile_image_url,screen_name,message,follower 
ORDER BY cast(min(postyear) as int),cast(min(postmonth) as int),cast(min(postday) as int),cast(min(posthour) as int) ASC; 

を私は次のエラーの結果

を得る何らかの理由であなたのクエリは、次のエラーが発生しました(S):

Bad status for request 3304: TGetOperationStatusResp(status=TStatus(errorCode=None, errorMessage=None, sqlState=None, infoMessages=None, statusCode=0), operationState=5, errorMessage=None, sqlState=None, errorCode=None) 

、私は、クエリを確認し、私はそれで問題を見つけることができない誰もが支援し、問題は、なぜ、私は結果ではなく、このエラーを持っているんです場所へ案内してくださいすることができますか? set

+1

そのメッセージはちょうど*「サーバが失敗した(あるいはクラッシュし)た」*意味します - なぜ、どのように理解するために、インパラのログ、サーバー側を調べてください。私はすでにデーモンが残酷な 'SEGV'の低レベルのプロセスエラーでクラッシュするのを見ました(C++は高速ですが、メモリ処理のバグは許されません...) –

答えて

1

スペースのような単純な問題のためにSQL解析自体が失敗した場合、ImpalaがSEGVでクラッシュするように、クエリを再フォーマットすることを慎重に検討してください。 Clouderaを実行している場合は、クエリを実行したノードにログが/run/cloudera-scm-agent/processにあります。

私たちは、SQLフォーマットに注意することでこれらの問題を解決しました。これは、クエリエラーを見つけやすくするための良い方法です。

SELECT 
    COUNT(p.id)              AS tweet_count, 
    p.author              AS author, 
    p.profile_image_url            AS profile_image_url, 
    p.screen_name             AS screen_name, 
    concat_ws('/', MIN(p.postday), MIN(p.postmonth), MIN(p.postyear)) AS creation_date, 
    p.message              AS MESSAGE, 
    af.followerid             AS follower 
FROM 
    post p 
INNER JOIN 
    author_follower af 
ON 
    af.id LIKE IF(p.author = NULL, '', concat(p.author, '%')) 
WHERE 
    p.hashtaglist LIKE 'hashtagtobeused' 
GROUP BY 
    author, 
    profile_image_url, 
    screen_name, 
    MESSAGE, 
    follower 
ORDER BY 
    CAST(MIN(postyear) AS INT), 
    CAST(MIN(postmonth) AS INT), 
    CAST(MIN(postday) AS INT), 
    CAST(MIN(posthour) AS INT) ASC; 

(ちなみに、私は、クエリの構文を検証し、再フォーマットするDbVisualizerのを使用 - を検討するのに最適なツールを)

関連する問題