├── .gitignore ├── jaffle_shop ├── seeds │ ├── .gitkeep │ ├── raw_customers.csv │ ├── raw_orders.csv │ └── raw_payments.csv ├── .gitignore ├── models │ ├── overview.md │ ├── staging │ │ ├── stg_customers.sql │ │ ├── stg_orders.sql │ │ └── stg_payments.sql │ ├── docs.md │ └── intermediate │ │ ├── orders.sql │ │ └── customers.sql ├── profiles.yml └── dbt_project.yml ├── Dockerfile.nginx ├── requirements.txt ├── Dockerfile.jupyter ├── Dockerfile.ucui ├── README.md ├── compose.yml ├── notebooks ├── dbt.ipynb └── duckdb.ipynb └── nginx.conf /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ -------------------------------------------------------------------------------- /jaffle_shop/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Dockerfile.nginx: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | WORKDIR /etc/nginx 4 | COPY nginx.conf ./conf.d/default.conf 5 | EXPOSE 80 6 | ENTRYPOINT [ "nginx" ] 7 | CMD [ "-g", "daemon off;" ] -------------------------------------------------------------------------------- /jaffle_shop/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | target/ 3 | dbt_packages/ 4 | dbt_modules/ 5 | logs/ 6 | **/.DS_Store 7 | .user.yml 8 | venv/ 9 | env/ 10 | **/*.duckdb 11 | **/*.duckdb.wal 12 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | git+https://github.com/godatadriven/dbt-duckdb.git#egg=dbt-duckdb[unity] # For running dbt jobs 2 | junity==0.7.8 # this is the unity catalog sidebar extension 3 | dunky[delta]==0.2.0 # this is duckdb unity kernel -------------------------------------------------------------------------------- /jaffle_shop/models/overview.md: -------------------------------------------------------------------------------- 1 | {% docs __overview__ %} 2 | 3 | ## Data Documentation for Jaffle Shop 4 | 5 | `jaffle_shop` is a fictional ecommerce store. 6 | 7 | This [dbt](https://www.getdbt.com/) project is for testing out code. 8 | 9 | The source code can be found [here](https://github.com/clrcrl/jaffle_shop). 10 | 11 | {% enddocs %} 12 | -------------------------------------------------------------------------------- /Dockerfile.jupyter: -------------------------------------------------------------------------------- 1 | # x86-64 is required for duckdb uc_catalog extension 2 | FROM quay.io/jupyter/minimal-notebook:x86_64-python-3.11 3 | 4 | # Install notebook dependencies 5 | COPY requirements.txt requirements.txt 6 | RUN pip install --no-cache-dir -r requirements.txt 7 | 8 | # Copy example notebooks 9 | COPY notebooks ${HOME}/notebooks 10 | COPY jaffle_shop ${HOME}/jaffle_shop 11 | 12 | WORKDIR ${HOME} 13 | 14 | EXPOSE 8888 15 | 16 | CMD ["jupyter", "lab"] -------------------------------------------------------------------------------- /jaffle_shop/models/staging/stg_customers.sql: -------------------------------------------------------------------------------- 1 | with source as ( 2 | 3 | {#- 4 | Normally we would select from the table here, but we are using seeds to load 5 | our data in this project 6 | #} 7 | select * from {{ ref('raw_customers') }} 8 | 9 | ), 10 | 11 | renamed as ( 12 | 13 | select 14 | id as customer_id, 15 | first_name, 16 | last_name 17 | 18 | from source 19 | 20 | ) 21 | 22 | select * from renamed 23 | -------------------------------------------------------------------------------- /jaffle_shop/models/staging/stg_orders.sql: -------------------------------------------------------------------------------- 1 | with source as ( 2 | 3 | {#- 4 | Normally we would select from the table here, but we are using seeds to load 5 | our data in this project 6 | #} 7 | select * from {{ ref('raw_orders') }} 8 | 9 | ), 10 | 11 | renamed as ( 12 | 13 | select 14 | id as order_id, 15 | user_id as customer_id, 16 | order_date, 17 | status 18 | 19 | from source 20 | 21 | ) 22 | 23 | select * from renamed 24 | -------------------------------------------------------------------------------- /jaffle_shop/profiles.yml: -------------------------------------------------------------------------------- 1 | jaffle_shop: 2 | outputs: 3 | dev: 4 | type: duckdb 5 | catalog: unity 6 | attach: 7 | - path: unity 8 | alias: unity 9 | type: UC_CATALOG 10 | extensions: 11 | - name: delta 12 | - name: uc_catalog 13 | repository: http://nightly-extensions.duckdb.org 14 | secrets: 15 | - type: UC 16 | token: 'not-used' 17 | endpoint: 'http://uc:8080' 18 | aws_region: 'eu-west-1' 19 | plugins: 20 | - module: unity 21 | target: dev 22 | 23 | -------------------------------------------------------------------------------- /jaffle_shop/models/staging/stg_payments.sql: -------------------------------------------------------------------------------- 1 | with source as ( 2 | 3 | {#- 4 | Normally we would select from the table here, but we are using seeds to load 5 | our data in this project 6 | #} 7 | select * from {{ ref('raw_payments') }} 8 | 9 | ), 10 | 11 | renamed as ( 12 | 13 | select 14 | id as payment_id, 15 | order_id, 16 | payment_method, 17 | 18 | -- `amount` is currently stored in cents, so we convert it to dollars 19 | amount / 100 as amount 20 | 21 | from source 22 | 23 | ) 24 | 25 | select * from renamed 26 | -------------------------------------------------------------------------------- /jaffle_shop/dbt_project.yml: -------------------------------------------------------------------------------- 1 | name: 'jaffle_shop' 2 | version: '1.0.0' 3 | 4 | profile: 'jaffle_shop' 5 | 6 | model-paths: ["models"] 7 | seed-paths: ["seeds"] 8 | test-paths: ["tests"] 9 | analysis-paths: ["analysis"] 10 | macro-paths: ["macros"] 11 | 12 | target-path: "target" 13 | clean-targets: 14 | - "target" 15 | - "dbt_modules" 16 | - "logs" 17 | 18 | seeds: 19 | +docs: 20 | node_color: '#cd7f32' 21 | 22 | models: 23 | jaffle_shop: 24 | intermediate: 25 | schema: "intermediate" 26 | staging: 27 | schema: "staging" 28 | +docs: 29 | node_color: 'silver' 30 | +docs: 31 | node_color: 'gold' 32 | 33 | -------------------------------------------------------------------------------- /Dockerfile.ucui: -------------------------------------------------------------------------------- 1 | # Use an official Node.js runtime as a parent image 2 | FROM node:18-alpine 3 | 4 | ARG UC_HOST 5 | 6 | # Set the working directory 7 | WORKDIR /app 8 | 9 | RUN wget https://github.com/unitycatalog/unitycatalog-ui/archive/refs/heads/main.zip \ 10 | && unzip main.zip \ 11 | && mv unitycatalog-ui-main unitycatalog-ui \ 12 | && rm main.zip 13 | 14 | WORKDIR /app/unitycatalog-ui 15 | 16 | # Modify package.json to include the UC_HOST 17 | RUN sed -i "s|\"proxy\": \".*\"|\"proxy\": \"$UC_HOST\"|" package.json 18 | 19 | # Install dependencies 20 | RUN yarn 21 | 22 | # Expose the port the app runs on 23 | EXPOSE 3000 24 | 25 | # Define the command to run the app 26 | CMD ["yarn", "start"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | This repository contains materials for a blog post demonstrating the integration between Unity Catalog and DuckDB. The examples provided showcase how to use DuckDB with Unity Catalog 4 | 5 | ## Prerequisites 6 | - Docker 7 | - Docker Compose 8 | 9 | ## Setup 10 | - Clone the repository: 11 | ```bash 12 | git clone 13 | ``` 14 | 15 | 16 | 17 | ## Usage 18 | To run the example, execute the following command: 19 | ```bash 20 | docker compose up --build -d 21 | ``` 22 | After starting the Docker containers, you can access the Jupyter notebooks at http://localhost:8888/lab?token=ducklake. The notebooks demonstrate how to use DuckDB with Unity Catalog for data management and querying. 23 | 24 | Open the notebooks: 25 | - Navigate to notebooks/dbt.ipynb to see dbt operations with DuckDB and Unity Catalog. 26 | - Navigate to notebooks/duckdb.ipynb to see SQL operations with DuckDB and Unity Catalog. 27 | 28 | You can reach the Unity Catalog at http://localhost:8080/api/2.1/unity-catalog. 29 | You can reach the Unity Catalog UI at http://localhost:3000 -------------------------------------------------------------------------------- /jaffle_shop/models/docs.md: -------------------------------------------------------------------------------- 1 | {% docs orders_status %} 2 | 3 | Orders can be one of the following statuses: 4 | 5 | | status | description | 6 | |----------------|------------------------------------------------------------------------------------------------------------------------| 7 | | placed | The order has been placed but has not yet left the warehouse | 8 | | shipped | The order has ben shipped to the customer and is currently in transit | 9 | | completed | The order has been received by the customer | 10 | | return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse | 11 | | returned | The order has been returned by the customer and received at the warehouse | 12 | 13 | 14 | {% enddocs %} 15 | -------------------------------------------------------------------------------- /compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | uc: 3 | image: godatadriven/unity-catalog 4 | ports: 5 | - 8080:8080 6 | volumes: 7 | - shared-data:/app/unitycatalog 8 | jupyter: 9 | user: root 10 | build: 11 | dockerfile: Dockerfile.jupyter 12 | environment: 13 | JUPYTER_TOKEN: ducklake 14 | HOME: /home/ducklake 15 | NB_USER: ducklake 16 | NB_UID: 1008 17 | NB_GID: 1011 18 | CHOWN_HOME: 'yes' 19 | CHOWN_HOME_OPTS: -R 20 | LOCATION_PREFIX: /home/ducklake/data 21 | UC_TOKEN: 'not-used' 22 | UC_ENDPOINT: 'http://uc:8080' 23 | UC_AWS_REGION: 'eu-west-1' 24 | JY_HOST_URL: http://localhost:8081 25 | JY_DOCKER_HOST: http://uc:8080 26 | ports: 27 | - 8888:8888 28 | depends_on: 29 | - uc 30 | volumes: 31 | - shared-data:/app/unitycatalog 32 | nginx: # (reverse proxy) Enables service on localhost running outside docker compose network to access UC Catalog API 33 | build: 34 | dockerfile: Dockerfile.nginx 35 | ports: 36 | - "8081:80" 37 | depends_on: 38 | - uc 39 | volumes: 40 | shared-data: -------------------------------------------------------------------------------- /notebooks/dbt.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "metadata": {}, 5 | "cell_type": "code", 6 | "source": "%cd ../jaffle_shop", 7 | "id": "2073b1a6060755d3", 8 | "outputs": [], 9 | "execution_count": null 10 | }, 11 | { 12 | "cell_type": "code", 13 | "id": "initial_id", 14 | "metadata": { 15 | "collapsed": true 16 | }, 17 | "source": "!dbt build", 18 | "outputs": [], 19 | "execution_count": null 20 | }, 21 | { 22 | "metadata": {}, 23 | "cell_type": "code", 24 | "source": "!dbt show --inline \"SELECT * FROM unity.intermediate.orders\" --limit 50", 25 | "id": "8e5ab2a20b0563f5", 26 | "outputs": [], 27 | "execution_count": null 28 | } 29 | ], 30 | "metadata": { 31 | "kernelspec": { 32 | "display_name": "Python 3", 33 | "language": "python", 34 | "name": "python3" 35 | }, 36 | "language_info": { 37 | "codemirror_mode": { 38 | "name": "ipython", 39 | "version": 2 40 | }, 41 | "file_extension": ".py", 42 | "mimetype": "text/x-python", 43 | "name": "python", 44 | "nbconvert_exporter": "python", 45 | "pygments_lexer": "ipython2", 46 | "version": "2.7.6" 47 | } 48 | }, 49 | "nbformat": 4, 50 | "nbformat_minor": 5 51 | } 52 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | upstream api { 2 | # Could be host.docker.internal - Docker for Mac/Windows - the host itself 3 | # Could be your API in a appropriate domain 4 | # Could be other container in the same network, like container_name:port 5 | server localhost:8080; 6 | } 7 | 8 | server { 9 | listen 80; 10 | server_name localhost; 11 | 12 | location /api/2.1/unity-catalog { 13 | proxy_pass http://uc:8080; 14 | 15 | 16 | if ($request_method = 'OPTIONS') { 17 | add_header 'Access-Control-Max-Age' 1728000; 18 | add_header 'Access-Control-Allow-Origin' '*'; 19 | add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent, 20 | X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; 21 | add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; 22 | add_header 'Content-Type' 'application/json'; 23 | add_header 'Content-Length' 0; 24 | return 204; 25 | } 26 | 27 | add_header 'Access-Control-Allow-Origin' '*'; 28 | add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent, 29 | X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; 30 | add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; 31 | 32 | } 33 | } -------------------------------------------------------------------------------- /jaffle_shop/models/intermediate/orders.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized='external_table', 3 | location="{{ env_var('LOCATION_PREFIX') }}/orders", 4 | plugin = 'unity') 5 | }} 6 | {% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %} 7 | 8 | with orders as ( 9 | 10 | select * from {{ ref('stg_orders')}} 11 | 12 | ), 13 | 14 | payments as ( 15 | 16 | select * from {{ ref('stg_payments')}} 17 | 18 | ), 19 | 20 | order_payments as ( 21 | 22 | select 23 | order_id, 24 | 25 | {% for payment_method in payment_methods -%} 26 | sum(case when payment_method = '{{ payment_method }}' then amount else 0 end) as {{ payment_method }}_amount, 27 | {% endfor -%} 28 | 29 | sum(amount) as total_amount 30 | 31 | from payments 32 | 33 | group by order_id 34 | 35 | ), 36 | 37 | final as ( 38 | 39 | select 40 | orders.order_id, 41 | orders.customer_id, 42 | orders.order_date, 43 | orders.status, 44 | 45 | {% for payment_method in payment_methods -%} 46 | 47 | order_payments.{{ payment_method }}_amount, 48 | 49 | {% endfor -%} 50 | 51 | order_payments.total_amount as amount 52 | 53 | from orders 54 | 55 | 56 | left join order_payments 57 | on orders.order_id = order_payments.order_id 58 | 59 | ) 60 | 61 | select * from final 62 | -------------------------------------------------------------------------------- /jaffle_shop/models/intermediate/customers.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized='external_table', 3 | location="{{ env_var('LOCATION_PREFIX') }}/customers", 4 | plugin = 'unity') 5 | }} 6 | with customers as ( 7 | 8 | select * from {{ ref('stg_customers') }} 9 | 10 | ), 11 | 12 | orders as ( 13 | 14 | select * from {{ ref('stg_orders') }} 15 | 16 | ), 17 | 18 | payments as ( 19 | 20 | select * from {{ ref('stg_payments') }} 21 | 22 | ), 23 | 24 | customer_orders as ( 25 | 26 | select 27 | customer_id, 28 | 29 | min(order_date) as first_order, 30 | max(order_date) as most_recent_order, 31 | count(order_id) as number_of_orders 32 | from orders 33 | 34 | group by customer_id 35 | 36 | ), 37 | 38 | customer_payments as ( 39 | 40 | select 41 | orders.customer_id, 42 | sum(amount) as total_amount 43 | 44 | from payments 45 | 46 | left join orders on 47 | payments.order_id = orders.order_id 48 | 49 | group by orders.customer_id 50 | 51 | ), 52 | 53 | final as ( 54 | 55 | select 56 | customers.customer_id, 57 | customers.first_name, 58 | customers.last_name, 59 | customer_orders.first_order, 60 | customer_orders.most_recent_order, 61 | customer_orders.number_of_orders, 62 | customer_payments.total_amount as customer_lifetime_value 63 | 64 | from customers 65 | 66 | left join customer_orders 67 | on customers.customer_id = customer_orders.customer_id 68 | 69 | left join customer_payments 70 | on customers.customer_id = customer_payments.customer_id 71 | 72 | ) 73 | 74 | select * from final 75 | -------------------------------------------------------------------------------- /jaffle_shop/seeds/raw_customers.csv: -------------------------------------------------------------------------------- 1 | id,first_name,last_name 2 | 1,Michael,P. 3 | 2,Shawn,M. 4 | 3,Kathleen,P. 5 | 4,Jimmy,C. 6 | 5,Katherine,R. 7 | 6,Sarah,R. 8 | 7,Martin,M. 9 | 8,Frank,R. 10 | 9,Jennifer,F. 11 | 10,Henry,W. 12 | 11,Fred,S. 13 | 12,Amy,D. 14 | 13,Kathleen,M. 15 | 14,Steve,F. 16 | 15,Teresa,H. 17 | 16,Amanda,H. 18 | 17,Kimberly,R. 19 | 18,Johnny,K. 20 | 19,Virginia,F. 21 | 20,Anna,A. 22 | 21,Willie,H. 23 | 22,Sean,H. 24 | 23,Mildred,A. 25 | 24,David,G. 26 | 25,Victor,H. 27 | 26,Aaron,R. 28 | 27,Benjamin,B. 29 | 28,Lisa,W. 30 | 29,Benjamin,K. 31 | 30,Christina,W. 32 | 31,Jane,G. 33 | 32,Thomas,O. 34 | 33,Katherine,M. 35 | 34,Jennifer,S. 36 | 35,Sara,T. 37 | 36,Harold,O. 38 | 37,Shirley,J. 39 | 38,Dennis,J. 40 | 39,Louise,W. 41 | 40,Maria,A. 42 | 41,Gloria,C. 43 | 42,Diana,S. 44 | 43,Kelly,N. 45 | 44,Jane,R. 46 | 45,Scott,B. 47 | 46,Norma,C. 48 | 47,Marie,P. 49 | 48,Lillian,C. 50 | 49,Judy,N. 51 | 50,Billy,L. 52 | 51,Howard,R. 53 | 52,Laura,F. 54 | 53,Anne,B. 55 | 54,Rose,M. 56 | 55,Nicholas,R. 57 | 56,Joshua,K. 58 | 57,Paul,W. 59 | 58,Kathryn,K. 60 | 59,Adam,A. 61 | 60,Norma,W. 62 | 61,Timothy,R. 63 | 62,Elizabeth,P. 64 | 63,Edward,G. 65 | 64,David,C. 66 | 65,Brenda,W. 67 | 66,Adam,W. 68 | 67,Michael,H. 69 | 68,Jesse,E. 70 | 69,Janet,P. 71 | 70,Helen,F. 72 | 71,Gerald,C. 73 | 72,Kathryn,O. 74 | 73,Alan,B. 75 | 74,Harry,A. 76 | 75,Andrea,H. 77 | 76,Barbara,W. 78 | 77,Anne,W. 79 | 78,Harry,H. 80 | 79,Jack,R. 81 | 80,Phillip,H. 82 | 81,Shirley,H. 83 | 82,Arthur,D. 84 | 83,Virginia,R. 85 | 84,Christina,R. 86 | 85,Theresa,M. 87 | 86,Jason,C. 88 | 87,Phillip,B. 89 | 88,Adam,T. 90 | 89,Margaret,J. 91 | 90,Paul,P. 92 | 91,Todd,W. 93 | 92,Willie,O. 94 | 93,Frances,R. 95 | 94,Gregory,H. 96 | 95,Lisa,P. 97 | 96,Jacqueline,A. 98 | 97,Shirley,D. 99 | 98,Nicole,M. 100 | 99,Mary,G. 101 | 100,Jean,M. 102 | -------------------------------------------------------------------------------- /notebooks/duckdb.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "fb0a32dcd3a96eab", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "ATTACH 'unity' AS unity (TYPE UC_CATALOG);" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "id": "c660945a4f69ff0c", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "SHOW ALL TABLES;" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": null, 26 | "id": "a6fc387f1d6354d", 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "SELECT * FROM unity.intermediate.customers LIMIT 10;" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": null, 36 | "id": "84a848570cae4eb7", 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "CREATE EXTERNAL TABLE unity.default.customers LOCATION '/home/ducklake/data/customers/' AS SELECT * FROM unity.intermediate.customers;" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "a42e2bc9e0078c00", 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "SELECT * FROM unity.default.customers LIMIT 20;" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "id": "b6dec8b8-bdf1-438b-b28f-7bc283db107c", 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [ 60 | "DETACH DATABASE unity;" 61 | ] 62 | } 63 | ], 64 | "metadata": { 65 | "kernelspec": { 66 | "display_name": "Dunky", 67 | "language": "sql", 68 | "name": "dunky" 69 | }, 70 | "language_info": { 71 | "codemirror_mode": "sql", 72 | "file_extension": ".sql", 73 | "mimetype": "text/x-sql", 74 | "name": "DuckDBSQL" 75 | } 76 | }, 77 | "nbformat": 4, 78 | "nbformat_minor": 5 79 | } 80 | -------------------------------------------------------------------------------- /jaffle_shop/seeds/raw_orders.csv: -------------------------------------------------------------------------------- 1 | id,user_id,order_date,status 2 | 1,1,2018-01-01,returned 3 | 2,3,2018-01-02,completed 4 | 3,94,2018-01-04,completed 5 | 4,50,2018-01-05,completed 6 | 5,64,2018-01-05,completed 7 | 6,54,2018-01-07,completed 8 | 7,88,2018-01-09,completed 9 | 8,2,2018-01-11,returned 10 | 9,53,2018-01-12,completed 11 | 10,7,2018-01-14,completed 12 | 11,99,2018-01-14,completed 13 | 12,59,2018-01-15,completed 14 | 13,84,2018-01-17,completed 15 | 14,40,2018-01-17,returned 16 | 15,25,2018-01-17,completed 17 | 16,39,2018-01-18,completed 18 | 17,71,2018-01-18,completed 19 | 18,64,2018-01-20,returned 20 | 19,54,2018-01-22,completed 21 | 20,20,2018-01-23,completed 22 | 21,71,2018-01-23,completed 23 | 22,86,2018-01-24,completed 24 | 23,22,2018-01-26,return_pending 25 | 24,3,2018-01-27,completed 26 | 25,51,2018-01-28,completed 27 | 26,32,2018-01-28,completed 28 | 27,94,2018-01-29,completed 29 | 28,8,2018-01-29,completed 30 | 29,57,2018-01-31,completed 31 | 30,69,2018-02-02,completed 32 | 31,16,2018-02-02,completed 33 | 32,28,2018-02-04,completed 34 | 33,42,2018-02-04,completed 35 | 34,38,2018-02-06,completed 36 | 35,80,2018-02-08,completed 37 | 36,85,2018-02-10,completed 38 | 37,1,2018-02-10,completed 39 | 38,51,2018-02-10,completed 40 | 39,26,2018-02-11,completed 41 | 40,33,2018-02-13,completed 42 | 41,99,2018-02-14,completed 43 | 42,92,2018-02-16,completed 44 | 43,31,2018-02-17,completed 45 | 44,66,2018-02-17,completed 46 | 45,22,2018-02-17,completed 47 | 46,6,2018-02-19,completed 48 | 47,50,2018-02-20,completed 49 | 48,27,2018-02-21,completed 50 | 49,35,2018-02-21,completed 51 | 50,51,2018-02-23,completed 52 | 51,71,2018-02-24,completed 53 | 52,54,2018-02-25,return_pending 54 | 53,34,2018-02-26,completed 55 | 54,54,2018-02-26,completed 56 | 55,18,2018-02-27,completed 57 | 56,79,2018-02-28,completed 58 | 57,93,2018-03-01,completed 59 | 58,22,2018-03-01,completed 60 | 59,30,2018-03-02,completed 61 | 60,12,2018-03-03,completed 62 | 61,63,2018-03-03,completed 63 | 62,57,2018-03-05,completed 64 | 63,70,2018-03-06,completed 65 | 64,13,2018-03-07,completed 66 | 65,26,2018-03-08,completed 67 | 66,36,2018-03-10,completed 68 | 67,79,2018-03-11,completed 69 | 68,53,2018-03-11,completed 70 | 69,3,2018-03-11,completed 71 | 70,8,2018-03-12,completed 72 | 71,42,2018-03-12,shipped 73 | 72,30,2018-03-14,shipped 74 | 73,19,2018-03-16,completed 75 | 74,9,2018-03-17,shipped 76 | 75,69,2018-03-18,completed 77 | 76,25,2018-03-20,completed 78 | 77,35,2018-03-21,shipped 79 | 78,90,2018-03-23,shipped 80 | 79,52,2018-03-23,shipped 81 | 80,11,2018-03-23,shipped 82 | 81,76,2018-03-23,shipped 83 | 82,46,2018-03-24,shipped 84 | 83,54,2018-03-24,shipped 85 | 84,70,2018-03-26,placed 86 | 85,47,2018-03-26,shipped 87 | 86,68,2018-03-26,placed 88 | 87,46,2018-03-27,placed 89 | 88,91,2018-03-27,shipped 90 | 89,21,2018-03-28,placed 91 | 90,66,2018-03-30,shipped 92 | 91,47,2018-03-31,placed 93 | 92,84,2018-04-02,placed 94 | 93,66,2018-04-03,placed 95 | 94,63,2018-04-03,placed 96 | 95,27,2018-04-04,placed 97 | 96,90,2018-04-06,placed 98 | 97,89,2018-04-07,placed 99 | 98,41,2018-04-07,placed 100 | 99,85,2018-04-09,placed 101 | -------------------------------------------------------------------------------- /jaffle_shop/seeds/raw_payments.csv: -------------------------------------------------------------------------------- 1 | id,order_id,payment_method,amount 2 | 1,1,credit_card,1000 3 | 2,2,credit_card,2000 4 | 3,3,coupon,100 5 | 4,4,coupon,2500 6 | 5,5,bank_transfer,1700 7 | 6,6,credit_card,600 8 | 7,7,credit_card,1600 9 | 8,8,credit_card,2300 10 | 9,9,gift_card,2300 11 | 10,9,bank_transfer,0 12 | 11,10,bank_transfer,2600 13 | 12,11,credit_card,2700 14 | 13,12,credit_card,100 15 | 14,13,credit_card,500 16 | 15,13,bank_transfer,1400 17 | 16,14,bank_transfer,300 18 | 17,15,coupon,2200 19 | 18,16,credit_card,1000 20 | 19,17,bank_transfer,200 21 | 20,18,credit_card,500 22 | 21,18,credit_card,800 23 | 22,19,gift_card,600 24 | 23,20,bank_transfer,1500 25 | 24,21,credit_card,1200 26 | 25,22,bank_transfer,800 27 | 26,23,gift_card,2300 28 | 27,24,coupon,2600 29 | 28,25,bank_transfer,2000 30 | 29,25,credit_card,2200 31 | 30,25,coupon,1600 32 | 31,26,credit_card,3000 33 | 32,27,credit_card,2300 34 | 33,28,bank_transfer,1900 35 | 34,29,bank_transfer,1200 36 | 35,30,credit_card,1300 37 | 36,31,credit_card,1200 38 | 37,32,credit_card,300 39 | 38,33,credit_card,2200 40 | 39,34,bank_transfer,1500 41 | 40,35,credit_card,2900 42 | 41,36,bank_transfer,900 43 | 42,37,credit_card,2300 44 | 43,38,credit_card,1500 45 | 44,39,bank_transfer,800 46 | 45,40,credit_card,1400 47 | 46,41,credit_card,1700 48 | 47,42,coupon,1700 49 | 48,43,gift_card,1800 50 | 49,44,gift_card,1100 51 | 50,45,bank_transfer,500 52 | 51,46,bank_transfer,800 53 | 52,47,credit_card,2200 54 | 53,48,bank_transfer,300 55 | 54,49,credit_card,600 56 | 55,49,credit_card,900 57 | 56,50,credit_card,2600 58 | 57,51,credit_card,2900 59 | 58,51,credit_card,100 60 | 59,52,bank_transfer,1500 61 | 60,53,credit_card,300 62 | 61,54,credit_card,1800 63 | 62,54,bank_transfer,1100 64 | 63,55,credit_card,2900 65 | 64,56,credit_card,400 66 | 65,57,bank_transfer,200 67 | 66,58,coupon,1800 68 | 67,58,gift_card,600 69 | 68,59,gift_card,2800 70 | 69,60,credit_card,400 71 | 70,61,bank_transfer,1600 72 | 71,62,gift_card,1400 73 | 72,63,credit_card,2900 74 | 73,64,bank_transfer,2600 75 | 74,65,credit_card,0 76 | 75,66,credit_card,2800 77 | 76,67,bank_transfer,400 78 | 77,67,credit_card,1900 79 | 78,68,credit_card,1600 80 | 79,69,credit_card,1900 81 | 80,70,credit_card,2600 82 | 81,71,credit_card,500 83 | 82,72,credit_card,2900 84 | 83,73,bank_transfer,300 85 | 84,74,credit_card,3000 86 | 85,75,credit_card,1900 87 | 86,76,coupon,200 88 | 87,77,credit_card,0 89 | 88,77,bank_transfer,1900 90 | 89,78,bank_transfer,2600 91 | 90,79,credit_card,1800 92 | 91,79,credit_card,900 93 | 92,80,gift_card,300 94 | 93,81,coupon,200 95 | 94,82,credit_card,800 96 | 95,83,credit_card,100 97 | 96,84,bank_transfer,2500 98 | 97,85,bank_transfer,1700 99 | 98,86,coupon,2300 100 | 99,87,gift_card,3000 101 | 100,87,credit_card,2600 102 | 101,88,credit_card,2900 103 | 102,89,bank_transfer,2200 104 | 103,90,bank_transfer,200 105 | 104,91,credit_card,1900 106 | 105,92,bank_transfer,1500 107 | 106,92,coupon,200 108 | 107,93,gift_card,2600 109 | 108,94,coupon,700 110 | 109,95,coupon,2400 111 | 110,96,gift_card,1700 112 | 111,97,bank_transfer,1400 113 | 112,98,bank_transfer,1000 114 | 113,99,credit_card,2400 115 | --------------------------------------------------------------------------------