claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

🔗aidp-fusion-bicc

説明

AIDPノートブックから、Fusion BICC一括抽出をSpark DataFrameに取り込みます。 次のような場合に使用: ユーザーがBICC、Fusion一括抽出、BI Cloud Connector、PVOについて言及している場合、またはFusionから5万行超のデータを必要としている場合。 推奨される手順では、AIDPの組み込みコネクター `spark.read.format("aidataplatform")` を使用します(Oracle AIDP公式サンプルに準拠)。認証方式はHTTPベーシック認証です。

原文を表示

Pull a Fusion BICC bulk extract into a Spark DataFrame from an AIDP notebook. Use when the user mentions BICC, Fusion bulk extract, BI Cloud Connector, PVO, or needs >50k rows from Fusion. The recommended path uses AIDP's built-in `spark.read.format("aidataplatform")` connector (matches the official Oracle AIDP sample). HTTP Basic auth.

ユースケース

  • Fusion BICCのデータをSparkに取り込む
  • 5万行超のFusionデータを処理する
  • BI Cloud Connectorでデータ抽出する

本文(日本語訳)

aidp-fusion-bicc — Fusion BICC バルクエクストラクト → Spark

Oracle 公式の AIDP サンプル(oracle-samples/oracle-aidp-samples → data-engineering/ingestion/Read_Only_Ingestion_Connectors.ipynb)を踏襲したスキルです。 BICC のデータを AIDP 組み込みの aidataplatform フォーマットハンドラー経由でルーティングします。


次のような場合に使用

  • Fusion からバルクエクストラクト(数百万行・日次スナップショット・フルテーブルロード)を行いたい場合
  • ユーザーが「BICC」「Fusion バルクエクストラクト」「BI Cloud Connector」「PVO エクストラクト」などに言及している場合
  • ライブ REST ページングでは遅すぎる場合(5万行超、または日次リフレッシュが必要な場合)

次のような場合には使用しない

  • 少量データのライブ REST クエリ → aidp-fusion-rest を使用すること

AIDP ノートブックの前提条件

  1. AIDP 側の準備(初回のみ・管理者が実施): BICC の書き込み先である OCI Object Storage バケットを指す EXTERNAL STORAGE プロファイルを AIDP カタログに登録する。 ノートブック内では fusion.external.storage でその名前を参照するだけでよく、OCI 認証情報をノートブックに直接記述する必要はない。

  2. Fusion 側の要件: Fusion ユーザーは BICC 管理者ロール(例: BIA_ADMINISTRATOR_DUTY)を持っている必要がある。 通常の Fusion REST ユーザー(Finance Manager ペルソナ等)では、BICC の JSON レスポンスではなく IDCS への 302 リダイレクトが返される(実環境で確認済み)。

  3. PVO(Public View Object)名と、そのソーススキーマ名(例: ERP

  4. sys.path に追加済みのヘルパーモジュール


認証: HTTP Basic(推奨パス = AIDP aidataplatform フォーマット)

Option A — AIDP 組み込みコネクター(推奨・公式サンプルと一致)

import os
from oracle_ai_data_platform_connectors.rest.fusion import read_bicc_via_aidp_format

df = read_bicc_via_aidp_format(
    spark=spark,
    fusion_service_url=os.environ["FUSION_BICC_BASE_URL"],
    username=os.environ["FUSION_BICC_USER"],            # BICC 権限が必須
    password=os.environ["FUSION_BICC_PASSWORD"],
    schema=os.environ["FUSION_BICC_SCHEMA"],            # 例: "ERP"
    datastore=os.environ["FUSION_BICC_PVO"],            # PVO 名
    fusion_external_storage=os.environ["FUSION_BICC_EXTERNAL_STORAGE"],
)
df.show(5)
print("rows:", df.count())

AIDP フォーマットハンドラーが内部で BICC のトリガー・ポーリング・マニフェスト読み取り・OCI Object Storage への CSV マテリアライズを処理するため、ユーザーは Spark DataFrame を受け取るだけで済みます。

公式 Oracle サンプルと同等の直接呼び出し方法:

df = (
    spark.read.format("aidataplatform")
        .option("type", "FUSION_BICC")
        .option("fusion.service.url", os.environ["FUSION_BICC_BASE_URL"])
        .option("user.name", os.environ["FUSION_BICC_USER"])
        .option("password", os.environ["FUSION_BICC_PASSWORD"])
        .option("schema", os.environ["FUSION_BICC_SCHEMA"])
        .option("fusion.external.storage", os.environ["FUSION_BICC_EXTERNAL_STORAGE"])
        .option("datastore", os.environ["FUSION_BICC_PVO"])
        .load()
)

Option B — カスタム REST トリガー + Object Storage 手動読み取り(フォールバック)

以下のいずれかに該当する場合のみ使用してください:

  • クラスター上で AIDP の aidataplatform コネクターが利用できない場合
  • カスタムのポーリング間隔が必要な場合
  • MANIFEST.MF を直接確認したい場合

注意: 公式サンプルでの検証はされていません。エンドポイントパスやレスポンスのスキーマはベストエフォートであり、Fusion のバージョンによっては調整が必要になる場合があります。

import os
from oracle_ai_data_platform_connectors.auth import http_basic_session
from oracle_ai_data_platform_connectors.rest.fusion import (
    trigger_bicc_extract, read_bicc_csv_from_object_storage,
)

session = http_basic_session(
    username=os.environ["FUSION_BICC_USER"],
    password=os.environ["FUSION_BICC_PASSWORD"],
    base_url=os.environ["FUSION_BICC_BASE_URL"],
)
prefix = trigger_bicc_extract(
    session=session,
    base_url=os.environ["FUSION_BICC_BASE_URL"],
    offering=os.environ["FUSION_BICC_OFFERING"],
    poll_interval_seconds=30,
    timeout_seconds=3600,
)
df = read_bicc_csv_from_object_storage(
    spark=spark,
    namespace=os.environ["OCI_NAMESPACE"],
    bucket=os.environ["OCI_BUCKET_BICC"],
    prefix=prefix,
)
print("rows:", df.count())

注意事項

  • BICC 権限について Fusion ユーザーは BICC 管理者ロールを持っている必要があります。 権限がない場合、/biacm/api/v[12]/* エンドポイントは IDCS OAuth への 302 リダイレクトを返し、HTTP Basic 認証は受け付けられません。 これがライブテスト失敗の最大の原因です。(Casey.Brown という Finance Manager ペルソナでデモ環境に対して実際に確認済み — すべての BICC エンドポイントがリダイレクトされました。)

  • fusion.external.storage はカタログ管理された名前であり、URL ではありません AIDP カタログ UI または oci aidataplatform CLI で一度設定し、以降は名前で参照します。 Option A を使用する場合、ノートブック内で OCI のネームスペースやバケットを直接記述する必要はありません。

  • schemadatastore について これらは BICC 固有の概念です。 schema = オファリングスキーマ(ERPHCM など)、datastore = PVO 名(例: FscmTopModelAM.AnalyticsServiceAM)。 BICC コンソールの「Configure Cloud Extract」から確認してください。

  • 初回エクストラクトは時間がかかります BICC がフルスナップショットを構築するため、初回実行は 5 分以上かかる場合があります。 2 回目以降は差分(インクリメンタル)処理になります。

  • 大きな CSV ではスキーマ推論が遅くなります(Option B の場合) Option A のコネクターは BICC メタデータからスキーマを事前に把握しているため、この問題は発生しません。


参考情報

原文(English)を表示

aidp-fusion-bicc — Fusion BICC bulk extract → Spark

Mirrors the official Oracle AIDP sample at oracle-samples/oracle-aidp-samples → data-engineering/ingestion/Read_Only_Ingestion_Connectors.ipynb, which routes BICC through AIDP's built-in aidataplatform format handler.

When to use

  • User wants a bulk extract from Fusion (millions of rows, daily snapshots, full-table loads).
  • User mentions: "BICC", "Fusion bulk extract", "BI Cloud Connector", "PVO extract".
  • Live REST paging would be too slow (>50k rows or daily refresh).

When NOT to use

Prerequisites in the AIDP notebook

  1. AIDP-side prep (one-time, by an administrator): an EXTERNAL STORAGE profile registered in the AIDP catalog pointing at the OCI Object Storage bucket BICC writes to. The user references it by name via fusion.external.storage — they don't supply OCI credentials in the notebook.
  2. Fusion-side requirement: the Fusion user must have a BICC-administrator role (e.g. BIA_ADMINISTRATOR_DUTY). A regular Fusion REST user (Finance Manager persona) gets a 302 to IDCS instead of BICC JSON — confirmed live.
  3. The PVO (Public View Object) name and its source schema (e.g. ERP).
  4. Helpers on sys.path.

Auth: HTTP Basic (Recommended path = AIDP aidataplatform format)

Option A — AIDP built-in connector (recommended; matches official sample)

import os
from oracle_ai_data_platform_connectors.rest.fusion import read_bicc_via_aidp_format

df = read_bicc_via_aidp_format(
    spark=spark,
    fusion_service_url=os.environ["FUSION_BICC_BASE_URL"],
    username=os.environ["FUSION_BICC_USER"],            # MUST have BICC privileges
    password=os.environ["FUSION_BICC_PASSWORD"],
    schema=os.environ["FUSION_BICC_SCHEMA"],            # e.g. "ERP"
    datastore=os.environ["FUSION_BICC_PVO"],            # the PVO name
    fusion_external_storage=os.environ["FUSION_BICC_EXTERNAL_STORAGE"],
)
df.show(5)
print("rows:", df.count())

The AIDP format handler does the BICC trigger, polling, manifest read, and OCI Object Storage CSV materialization internally — the user just gets a Spark DataFrame.

Equivalent verbatim invocation (same as the official Oracle sample):

df = (
    spark.read.format("aidataplatform")
        .option("type", "FUSION_BICC")
        .option("fusion.service.url", os.environ["FUSION_BICC_BASE_URL"])
        .option("user.name", os.environ["FUSION_BICC_USER"])
        .option("password", os.environ["FUSION_BICC_PASSWORD"])
        .option("schema", os.environ["FUSION_BICC_SCHEMA"])
        .option("fusion.external.storage", os.environ["FUSION_BICC_EXTERNAL_STORAGE"])
        .option("datastore", os.environ["FUSION_BICC_PVO"])
        .load()
)

Option B — Custom REST trigger + manual Object Storage read (fallback)

Only use this when the AIDP aidataplatform connector isn't available on the cluster, when you need a custom polling cadence, or when you want to inspect the MANIFEST.MF directly. NOT validated against the official sample — endpoint paths and response schema are best-effort and may need adjustment per Fusion version.

import os
from oracle_ai_data_platform_connectors.auth import http_basic_session
from oracle_ai_data_platform_connectors.rest.fusion import (
    trigger_bicc_extract, read_bicc_csv_from_object_storage,
)

session = http_basic_session(
    username=os.environ["FUSION_BICC_USER"],
    password=os.environ["FUSION_BICC_PASSWORD"],
    base_url=os.environ["FUSION_BICC_BASE_URL"],
)
prefix = trigger_bicc_extract(
    session=session,
    base_url=os.environ["FUSION_BICC_BASE_URL"],
    offering=os.environ["FUSION_BICC_OFFERING"],
    poll_interval_seconds=30,
    timeout_seconds=3600,
)
df = read_bicc_csv_from_object_storage(
    spark=spark,
    namespace=os.environ["OCI_NAMESPACE"],
    bucket=os.environ["OCI_BUCKET_BICC"],
    prefix=prefix,
)
print("rows:", df.count())

Gotchas

  • BICC privileges — Fusion user must hold a BICC-admin role. Without it, /biacm/api/v[12]/* endpoints 302-redirect to IDCS OAuth (HTTP Basic isn't honored). This is the #1 reason live tests fail. (Live-confirmed against the demo pod with Casey.Brown finance-mgr persona — every BICC endpoint redirected.)
  • fusion.external.storage is a catalog-managed name, not a URL. Set it up once via AIDP Catalog UI (or oci aidataplatform CLI), then reference by name. The user never types OCI namespace/bucket in the notebook for Option A.
  • schema and datastore — these are BICC concepts: schema = offering schema (ERP, HCM, etc.); datastore = PVO name (e.g. FscmTopModelAM.AnalyticsServiceAM). Get them from the BICC console under "Configure Cloud Extract".
  • First extract is slow — BICC builds a full snapshot. Subsequent runs are incremental. Plan for >5 min on the first call.
  • Schema inference is slow on big CSVs (Option B path). Option A's connector knows the schema in advance from the BICC metadata.

References

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。