Skip to content

spec: Variant lower/upper bounds - #12658

Merged
amogh-jahagirdar merged 6 commits into
apache:mainfrom
aihuaxu:variant-bound-spec
Apr 21, 2025
Merged

spec: Variant lower/upper bounds#12658
amogh-jahagirdar merged 6 commits into
apache:mainfrom
aihuaxu:variant-bound-spec

Conversation

@aihuaxu

@aihuaxuaihuaxu commented Mar 26, 2025

Copy link
Copy Markdown
Contributor

This is to revise the bounds specification for Variant. In summary:

The writer determines which fields to collect bounds for in a Variant column. Field bounds are stored as serialized Variant objects, where each key is a normalized JSON path identifying a field, and each value is the corresponding lower or upper bound.

E.g.

For a Variant column with the schema as follows:

{
"event_type": "login",
"user.name": "Alex", "tags": ["action", "drama"]
}

The collected bound object looks like:

{
"$['event_type']": "login",
"$['user.name']": "Alex",
"$['tags']": "action"
}

@github-actionsgithub-actionsBot added the Specification Issues that may introduce spec changes. label Mar 26, 2025
@aihuaxu

Copy link
Copy Markdown
ContributorAuthor

Comment threadformat/spec.md Outdated
Comment threadformat/spec.md Outdated
Comment threadformat/spec.md Outdated
Comment threadformat/spec.md Outdated
Comment threadformat/spec.md Outdated
Comment threadformat/spec.md Outdated

@xxubaixxubai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@danielcweeks

Copy link
Copy Markdown
Contributor

@aihuaxu and @rdblue is there a reason we need to explicitly restrict the lower/upper bounds to shredded fields? I would think that the stats pruning would be useful for any field that a writer would want to include in the bound (regardless of whether it was shredded or not).

@aihuaxu

Copy link
Copy Markdown
ContributorAuthor

@aihuaxu and @rdblue is there a reason we need to explicitly restrict the lower/upper bounds to shredded fields? I would think that the stats pruning would be useful for any field that a writer would want to include in the bound (regardless of whether it was shredded or not).

What we were thinking is that the bounds are collected from shredded column stats during shredding process. But it does seem reasonable to me to bounds and shredding can be separated: if a writer has the knowledge of the bounds and chooses not to shred, the bounds can still be used in pruning.

Comment threadformat/spec.md Outdated
Comment threadformat/spec.md
Comment threadformat/spec.md Outdated
Improve the wording
Co-authored-by: Ryan Blue <blue@apache.org>
Comment threadformat/spec.md Outdated
Comment threadformat/spec.md Outdated

@RussellSpitzerRussellSpitzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, I think we need to clarify a bit here

Comment threadformat/spec.md Outdated
* `$` -- the Variant root value
* `$['user.name']` -- the field `"user.name"` in the root value that is a Variant object
* `$['location']['latitude']` -- the field `latitude` in a nested `location` object
* `$['ids']` -- the `ids` array

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When I read the thread you raised on the dev list, I liked that you used "tags" as the example. Maybe we should change some of these to match the examples in the variant shredding spec?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Let me do that to match as much as possible.

aihuaxuand others added 2 commits April 18, 2025 16:46
Clarify some sentences.
Co-authored-by: Russell Spitzer <russell.spitzer@GMAIL.COM>
@aihuaxu
aihuaxuforce-pushed the variant-bound-spec branch from b16f660 to 9a99971CompareApril 19, 2025 16:37
@amogh-jahagirdar

Copy link
Copy Markdown
Contributor

Thanks @RussellSpitzer@rdblue@Fokko@flyrain@huaxingao @XBaith for reviewing and everyone for voting. Since the vote passed, I'll go ahead and merge

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SpecificationIssues that may introduce spec changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@aihuaxu@danielcweeks@amogh-jahagirdar@rdblue@RussellSpitzer@Fokko@flyrain@huaxingao@xxubai