CData ODBC Driver for ADLS は、DBArtisan などのデータベースツールとAzure Data Lake Storage data を連携し、RDB のような感覚でAzure Data Lake Storage データを扱えます。
本記事では、DBArtisan 上でAzure Data Lake Storage データソースを作成する方法とクエリの実行方法を説明します。
DBArtisan Project にAzure Data Lake Storage Data を連携する
ODBC Driver をインストールして、ODBC DSN 設定を行います。インストール後にDSN 設定画面が開くので、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.
次の方法で、プロジェクトにAzure Data Lake Storage データソースを登録します。
- DBArtisan で「Data Source」->「Register Datasource」と進みます。
- 「Generic ODBC」を選択。
- データソース名を入力して、DSN を選択します。Enter a name for the data source and select the DSN.
- ウィザードを終了してAzure Data Lake Storage への接続を完了します。Azure Data Lake Storage のエンティティが Datasource Explorer に表示されているはずです。
これで、他のデータベースと同じようにAzure Data Lake Storage データを扱うことが可能になります。
サポートされるSQL クエリは、ドライバーのヘルプドキュメントを参照してください。