Google スプレッドシートは、無償で試用できるWeb スプレッドシートプログラムです。CData Connect Server と一緒に使うことで、Google スプレッドシート上でAzure Data Lake Storage データをリアルタイムで連携利用して、表示、分析、共有、計算が可能になります。本記事では、Azure Data Lake Storage データにCData Connect Server インターフェース経由でGoogle スプレッドシートから連携利用する方法を紹介します。
CData Connect Server は、Azure Data Lake Storage データのインターフェースを提供し、Google スプレッドシートからリアルタイムAzure Data Lake Storage データに連携することができます。Google スプレッドシートの公式アドオンであるConnect Server Connector を使って、クエリを実行できます。CData Connect Server がクエリ(フィルタリングやJOIN も可能)をパースしてAzure Data Lake Storage に送り、Google スプレッドシートにAzure Data Lake Storage からのデータを返します。インテリジェントなサーバーサイドプロセスで、多様なクエリをパフォーマンス良く利用できます。
NOTE:Google スプレッドシート からCData Connect Server に接続するには、利用するCData Connect Server インスタンスをネットワーク経由での接続が可能なサーバーにホスティングして、URL(例えば、myConnectInstance.cdata.com)での接続が可能な状態にしてください。CData Connect がローカルでホスティングされており、localhost アドレス(例えば、localhost:8080)またはローカルネットワークのIP アドレス(例えば、192.168.1.x)からしか接続できない場合、Google スプレッドシート はCData Connect Server に接続することができません。
CData Connect Server からAzure Data Lake Storage に接続
CData Connect Server は、直観的なPoint-and-click インターフェースでデータソースへの接続およびAPI エンドポイント作成を行います。
- Connect Server にログインして、Databases をクリックします。
- 利用できるデータソースアイコンから"Azure Data Lake Storage" を選択します。
-
Azure Data Lake Storage に接続するために必要なプロパティを入力します。
Authenticating to a Gen 1 DataLakeStore Account
Gen 1 uses OAuth 2.0 in Azure AD for authentication.
For this, an Active Directory web application is required. You can create one as follows:
- Sign in to your Azure Account through the
[.
]- Select "Azure Active Directory".
- Select "App registrations".
- Select "New application registration".
- Provide a name and URL for the application. Select Web app for the type of application you want to create.
- Select "Required permissions" and change the required permissions for this app. At a minimum, "Azure Data Lake" and "Windows Azure Service Management API" are required.
- Select "Key" and generate a new key. Add a description, a duration, and take note of the generated key. You won't be able to see it again.
To authenticate against a Gen 1 DataLakeStore account, the following properties are required:
- Schema: Set this to ADLSGen1.
- Account: Set this to the name of the account.
- OAuthClientId: Set this to the application Id of the app you created.
- OAuthClientSecret: Set this to the key generated for the app you created.
- TenantId: Set this to the tenant Id. See the property for more information on how to acquire this.
- Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.
Authenticating to a Gen 2 DataLakeStore Account
To authenticate against a Gen 2 DataLakeStore account, the following properties are required:
- Schema: Set this to ADLSGen2.
- Account: Set this to the name of the account.
- FileSystem: Set this to the file system which will be used for this account.
- AccessKey: Set this to the access key which will be used to authenticate the calls to the API. See the property for more information on how to acquire this.
- Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.
- Test Database をクリックします。
- Permission -> Add をクリックして、新しいユーザーを追加し、適切な権限を指定します。
これで、Azure Data Lake Storage の仮想データベースが作成でき、Google スプレッドシートからの連携が可能になりました。
Google スプレッドシートからリアルタイムAzure Data Lake Storage データにアクセス
以下の手順で、Google スプレッドシートでCData Connect Server を使って、Azure Data Lake Storage データソースを取得します。
- Google スプレッドシートにログインし、新しいシートを作成します。
- アドオンをクリックし、「アドオンを取得」をクリックします。すでにCData Connect コネクタアドオンを取得済みの場合には5 までスキップします。
- CData Connect を検索して、クリックしてインストールします。
- コネクタにアカウントにアクセスする権限を与えます。
- Google スプレッドシートに戻り、アドオンからCData Connect を選択します。
- (myinstance にCONNECT_SERVER_URL)、username、password を入力してCData Connect にアクセスします。
- CREATE をクリックして、Azure Data Lake Storage にCData Connect 経由で接続します。
- Database (例えば、ADLS1) を選択して、Next をクリックします。
- Table (例えば、Resources) およびFields (columns) を選択し、ソート、フィルタリング、クエリリミット(行)を設定して、Execute を押してクエリを実行します。
アプリケーションからAzure Data Lake Storage データにSQL アクセスを実現
このようにGoogle スプレッドシートからAzure Data Lake Storage データに連携ができました。もちろんワークブックで計算、集計、共有などが可能です。
アプリケーションから240+ SaaS、ビッグデータ、NoSQL にSQL でデータ連携するには、CData Connect Server を是非お試しください。