やりたいこと
- Azure HDinsightクラスタのHiveでAzure Data Lake Storeに格納しているデータファイル (e.g., TSVファイル)を読み込む
- HiveはPythonから呼びたい
- 取得したデータはPandasのDataFrameとして扱いたい
全体の流れ
- Azure VMの作成
- Azure VMでJupyter Notebookを起動
- Notebookをアップロード
Azure VMの作成
ここは僕知らない、やってもらったから
こちらを参考にすれば作成できそう
Linux仮想マシン | Microsoft Doc
Azure VMでJupyter Notebookを起動
こちらの[接続]ボタンの左の[開始]ボタンがVM起動のためのボタン
Linux仮想マシン - 仮想マシンへの接続 | Microsoft Doc
PythonからHiveのクエリを投げるためのJupyter Notebook
Submit Queries to Azure HDInsight Hive Cluster in Jupyter Notebooks | Azure AI Gallery
Jupyter NotebookをVM上で起動
上のNotebookをUpload
実行しても以下のエラーが出た
ImportErrorTraceback (most recent call last)
<ipython-input-1-7e15b2d6f6c9> in <module>()
11 # You need the Azure SDK package to download the stdout of hive queries
12 # which is stored in Azure blob.
---> 13 from azure.storage.blob import BlobService
14 warnings.filterwarnings("ignore", category=UserWarning, module='urllib2')
15
ImportError: No module named azure.storage.blob
これを参考にパッケージ入れ直してみる
Install Azure Python api on linux: importError: No module named storage.blob
- SrtackOverflow