Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
airflow-dags-hub
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
唐香港
airflow-dags-hub
Commits
bcdcf1f9
Commit
bcdcf1f9
authored
Jul 23, 2020
by
吴升宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update index
parent
5dd2a6da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
create_table_per_day.py
dags/psql/create_table_per_day.py
+13
-0
No files found.
dags/psql/create_table_per_day.py
View file @
bcdcf1f9
...
@@ -52,6 +52,10 @@ sql3 = """
...
@@ -52,6 +52,10 @@ sql3 = """
"""
.
format
(
month
=
month
)
"""
.
format
(
month
=
month
)
print
(
sql3
)
print
(
sql3
)
sql4
=
"""
create index user_id_event_time_events_{month} on events_{month}(user_id, event_time);
"""
.
format
(
month
=
month
)
t1
:
PostgresOperator
=
PostgresOperator
(
t1
:
PostgresOperator
=
PostgresOperator
(
task_id
=
'psql_auto_create_table_per_day_task_01'
,
task_id
=
'psql_auto_create_table_per_day_task_01'
,
...
@@ -74,5 +78,14 @@ t3 = PostgresOperator(
...
@@ -74,5 +78,14 @@ t3 = PostgresOperator(
dag
=
dag
,
dag
=
dag
,
database
=
'ruler'
)
database
=
'ruler'
)
t4
=
PostgresOperator
(
task_id
=
'psql_auto_create_table_per_month_task_04'
,
postgres_conn_id
=
'postgres-test'
,
sql
=
sql4
,
dag
=
dag
,
database
=
'ruler'
)
t1
>>
t2
t1
>>
t2
t2
>>
t3
t2
>>
t3
t3
>>
t4
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment