Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timing perfromance and user-agent models #41

Merged
merged 2 commits into from
Jan 21, 2019

Conversation

sphinks
Copy link
Contributor

@sphinks sphinks commented Jan 10, 2019

Fixing issue #40

@drewbanin
Copy link
Collaborator

@sphinks I just kicked off the tests and it looks like everything is passing. That's probably because we're not currently testing these "optional" models though 🙃

This change may break existing projects, but I think it's good to be consistent with Snowplow's field names. Let me give this a quick spin locally to make sure we're in good shape, and then I think we can merge this!

Copy link
Collaborator

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave this another look with some fresh eyes and have a couple of quick questions!

@@ -17,7 +17,7 @@ web_page_context as (
prep as (

select
wp.page_view_id,
wp.id,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, does the web_page_context model have a field called id? I think at present, web_page_context exposes two fields:

  • root_id
  • page_view_id

Does this work?

@@ -18,7 +18,7 @@ prep AS (

SELECT

wp.page_view_id,
wp.id,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here -- I don't believe there's an id field in the snowplow_base_web_page_context model?

@drewbanin drewbanin dismissed their stale review January 15, 2019 18:55

i was wrong

@drewbanin
Copy link
Collaborator

Gosh... this code is kind of a mess.... So these optional models select directly from the web_page_context base model. I get it.

I think that we can indeed select the id column (as you have in this PR) or we could switch it to use the snowplow_web_page_context model which includes

  1. renamed fields
  2. deduplicated rows

Curious to hear which of these approaches you think is preferable

@sphinks
Copy link
Contributor Author

sphinks commented Jan 16, 2019

Let me a dig a little deeper, because I check at my side and for sure I get an error:

column wp.page_view_id does not exist
compiled SQL at target/compiled/snowplow/page_views/optional/snowplow_web_timing_context.sql

in case of original code. We'll take a look on you comment, to understand the rootcause.

@drewbanin
Copy link
Collaborator

Cool, thanks @sphinks! I appreciate your help and insight here :)

Let me know what you find!

…ssed web page context to avoid code duplication, revert field renaming
@sphinks
Copy link
Contributor Author

sphinks commented Jan 20, 2019

@drewbanin Have reverted rename of fields and switch referencing from base model to preprocessed web context model, to reuse de-duplication and all the rest code. Please, take a look.

@drewbanin
Copy link
Collaborator

Thanks @sphinks, this LGTM! Will merge this today

@drewbanin drewbanin merged commit 35bd68b into dbt-labs:master Jan 21, 2019
@sphinks
Copy link
Contributor Author

sphinks commented Jan 21, 2019

@drewbanin Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants