0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Databricksにて上位階層/並列階層にあるノートブックに対して%runを実施する方法

0
Posted at

概要

Databricksにて上位階層にあるノートブックに対して%runを実施するには、一般的な方法と同様に、%runの呼び出しもとを".."と記載することで実行できます。

この記事では、"run"というノートブックから"select"というノートブックを実行するという検証結果を記載します。

検証① 上位のディレクトリにあるノートブックの実行

1. ディレクトリを構成

下記のような構成を作成します。

.
│  select
│
└─pipeline
        run

image.png

2."select"というノートブックにコードを記載

%sql
SET TIME ZONE 'Asia/Tokyo';
select now()

image.png

3."run"というノートブックにコードを記載して実行

%run ../select 

image.png

検証② "run"と並列関係にあるディレクトリのノートブックの実行

1. ディレクトリを構成

下記のような構成を作成します。

.
├─code
│      select
│
└─pipeline
        run

image.png

2."select"というノートブックにコードを記載

%sql
SET TIME ZONE 'Asia/Tokyo';
select now()

image.png

3."run"というノートブックにコードを記載して実行

%run ../code/select 

image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?