2

SNE GP Edition のテーブルの 1 つで設定された Insert Trigger から関数を呼び出そうとすると、次のエラーが発生します。

ERROR:  Functions that execute SQL statements from the segDBs are not yet supported (spi.c:203)  (seg0 localhost:50001 pid=5504)
DETAIL:  
  SQL statement "SELECT DISTINCT min(zasn) FROM zeusasn WHERE zasn IN (SELECT asn FROM asntable where ip >>= '10.29.249.121')"
PL/pgSQL function "eptriggerfn" line 5 at SQL statement

********** Error **********

ERROR: Functions that execute SQL statements from the segDBs are not yet supported (spi.c:203)  (seg0 localhost:50001 pid=5504)
SQL state: XX000
Detail: 
  SQL statement "SELECT DISTINCT min(zasn) FROM zeusasn WHERE zasn IN (SELECT asn FROM asntable where ip >>= '10.29.249.121')"
PL/pgSQL function "eptriggerfn" line 5 at SQL statement

これの原因は何ですか?トリガー + 関数は、同じ DB 内の別のテーブルで完全に正常に機能しています。

前もって感謝します!

Rgds、キラン

4

1 に答える 1

3

Greenplumは複数のノードに分散処理を行うため、クエリ内のクエリは完全な処理機能を利用できないため、サポートされていません。

切り替えを行ったとき、同様の問題が発生しました。

select      *,
            country_name(country_id)
from        sales
where       country_id in (224, 105);

この関数country_name()は基本的に、国名を取得するためにIDごとにサブクエリを実行しました。したがって、クエリを次のように変更する必要がありました。

select      *,
            c.country_name
from        sales
left join   country as c using (country_id)
where       country_id in (224, 105);

...そして問題は解決されました。大変な作業のように思えますが、メリットはそれだけの価値があります。

于 2011-03-09T17:04:49.867 に答える