Skip to content

Conversation

@StewartJingga
Copy link
Contributor

  • new disable_preview config on bigquery extractor

@rohilsurana
Copy link
Member

One thought I had was to let preview have its own config struct. I noticed that there is a var previewTotalRows. If in future we could have a need to expose it as a config and more such stuff can be introduced, we can as of now start with a struct for PreviewConfigs and have disable and totalRows as its fields.

Functionally the PR looks good to me.

@StewartJingga
Copy link
Contributor Author

One thought I had was to let preview have its own config struct. I noticed that there is a var previewTotalRows. If in future we could have a need to expose it as a config and more such stuff can be introduced, we can as of now start with a struct for PreviewConfigs and have disable and totalRows as its fields.

Functionally the PR looks good to me.

Makes sense, but another thought is, should we just use TotalPreviewRows? we can put 0 to disable preview fetching and will default to 30 or other numbers.

Do you think it's better or do you see limitiations with it?

@rohilsurana
Copy link
Member

I think that could work as well, so we put a check on the TotalPreviewRows to return if its equal or less than 0, to avoid even triggering the BQ query.

I think we can start with this. It makes it implicit but should be fine.

@StewartJingga
Copy link
Contributor Author

@rohilsurana updated here. 🙏

@StewartJingga
Copy link
Contributor Author

StewartJingga commented Sep 30, 2021

@rohilsurana actually we need another flag for disable. We can do like what you propose using nested config here.

reason is, when I put 0 as the config, it will be treated as an empty value and set it to its default value (30 atm). So we would never be able to get 0 as the MaxPreviewRows.

@rohilsurana
Copy link
Member

That sounds like a bug of how we are loading the values into config struct, do you maybe want to address it there?
Is this happening using the odpf/salt/config package?

@rohilsurana
Copy link
Member

rohilsurana commented Sep 30, 2021

Just checked we are setting the defaults here - https://github.com/odpf/meteor/blob/dd15e2532141bd5fb7d7d0bd591edc4e66266132/utils/config.go#L17-L22

I think we should load the defaults first into the struct and then the configs from configMap.
Is there any specific reason that I am missing to load defaults later?

@StewartJingga
Copy link
Contributor Author

StewartJingga commented Oct 1, 2021

I think we should load the defaults first into the struct and then the configs from configMap.
Is there any specific reason that I am missing to load defaults later?

@rohilsurana oh there's no specific reason, was just a wrong order and behaviour. Updated the PR with the fix 🙏 .

@StewartJingga StewartJingga merged commit b2be9eb into main Oct 2, 2021
@StewartJingga StewartJingga deleted the preview-configurable branch October 2, 2021 02:21
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.

bigquery extractor takes much longer time due to preview extraction

4 participants