From d435129311f234c3274128d16a4aa5219dc8a9da Mon Sep 17 00:00:00 2001 From: Drew Banin Date: Sat, 13 May 2017 09:32:01 -0400 Subject: [PATCH] support sort_type (interleaved|compound) for models --- dbt/contracts/graph/parsed.py | 2 ++ .../001_simple_copy_test/models/compound_sort.sql | 9 +++++++++ .../001_simple_copy_test/models/interleaved_sort.sql | 9 +++++++++ 3 files changed, 20 insertions(+) create mode 100644 test/integration/001_simple_copy_test/models/compound_sort.sql create mode 100644 test/integration/001_simple_copy_test/models/interleaved_sort.sql diff --git a/dbt/contracts/graph/parsed.py b/dbt/contracts/graph/parsed.py index 2c6af294312..aca9a43e5c9 100644 --- a/dbt/contracts/graph/parsed.py +++ b/dbt/contracts/graph/parsed.py @@ -28,6 +28,8 @@ # adapter optional fields Optional('sort'): Any(basestring, list), Optional('dist'): basestring, + + Optional('sort_type'): Any('compound', 'interleaved'), } parsed_node_contract = unparsed_node_contract.extend({ diff --git a/test/integration/001_simple_copy_test/models/compound_sort.sql b/test/integration/001_simple_copy_test/models/compound_sort.sql new file mode 100644 index 00000000000..236de4a08b9 --- /dev/null +++ b/test/integration/001_simple_copy_test/models/compound_sort.sql @@ -0,0 +1,9 @@ +{{ + config( + materialized = "table", + sort = 'first_name', + sort_type = 'compound' + ) +}} + +select * from "{{ target.schema }}"."seed" diff --git a/test/integration/001_simple_copy_test/models/interleaved_sort.sql b/test/integration/001_simple_copy_test/models/interleaved_sort.sql new file mode 100644 index 00000000000..ff4eba3c19b --- /dev/null +++ b/test/integration/001_simple_copy_test/models/interleaved_sort.sql @@ -0,0 +1,9 @@ +{{ + config( + materialized = "table", + sort = ['first_name', 'last_name'], + sort_type = 'interleaved' + ) +}} + +select * from "{{ target.schema }}"."seed"