-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(hogql): properties between shards #14549
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
05a28d4
experimental property sharding
mariusandra fba2c50
fixes
mariusandra 6673ef9
more fixes
mariusandra 4775150
comment
mariusandra f1da0f5
failing query
mariusandra 48bb8d8
fix error if fetching "properties" AND "properties.name" from lazy table
mariusandra e2faee6
Merge branch 'master' into property-shard
mariusandra 7d01e94
Update query snapshots
github-actions[bot] 9171a5c
works with materialized properties!
mariusandra bfc10b7
do not select all the properties
mariusandra 7277d86
rename
mariusandra cb547bb
fancy modern python
mariusandra d933586
simpler if
mariusandra d2b9a1f
cleanup
mariusandra 85f362e
Merge branch 'master' into property-shard
mariusandra 23139b3
it's a ref now
mariusandra 1d3afe4
Merge branch 'master' into property-shard
mariusandra b55e141
Merge branch 'master' into property-shard
mariusandra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,16 +60,29 @@ def test_fields_and_properties(self): | |
"replaceRegexpAll(JSONExtractRaw(properties, %(hogql_val_0)s), '^\"|\"$', '')", | ||
) | ||
|
||
context = HogQLContext() | ||
context = HogQLContext(within_non_hogql_query=True, using_person_on_events=False) | ||
self.assertEqual( | ||
self._expr("person.properties.bla", context), | ||
"replaceRegexpAll(JSONExtractRaw(events__pdi__person.properties, %(hogql_val_0)s), '^\"|\"$', '')", | ||
"replaceRegexpAll(JSONExtractRaw(person_props, %(hogql_val_0)s), '^\"|\"$', '')", | ||
) | ||
|
||
context = HogQLContext(within_non_hogql_query=True, using_person_on_events=False) | ||
context = HogQLContext(within_non_hogql_query=True, using_person_on_events=True) | ||
self.assertEqual( | ||
self._expr("person.properties.bla", context), | ||
"replaceRegexpAll(JSONExtractRaw(person_props, %(hogql_val_0)s), '^\"|\"$', '')", | ||
"replaceRegexpAll(JSONExtractRaw(person_properties, %(hogql_val_0)s), '^\"|\"$', '')", | ||
) | ||
|
||
context = HogQLContext(within_non_hogql_query=False, using_person_on_events=False) | ||
self.assertEqual( | ||
self._expr("person.properties.bla", context), | ||
"events__pdi__person.properties___bla", | ||
) | ||
|
||
context = HogQLContext(within_non_hogql_query=False, using_person_on_events=True) | ||
self.assertEqual( | ||
# TODO: for now, explicitly writing "poe." to opt in. Automatic switching will come soon. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HogQL is not yet able to turn PoE (in its current form) on or off depending on the team's settings. It is doing this inside existing insights (non-hogql queries), but not in full hogql queries. This is planned for another PR. |
||
self._expr("poe.properties.bla", context), | ||
"replaceRegexpAll(JSONExtractRaw(events.person_properties, %(hogql_val_0)s), '^\"|\"$', '')", | ||
) | ||
|
||
def test_hogql_properties(self): | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously
events.
was added beforeproperties
to disambiguate it from theevents__pdi__person.properties
column that we selected in the join. That's no longer the case and thus it seems like it was automatically removed.