Docs: Fix non-existent SortOrderBuilder method in evolution.md example

Open Beginner friendly
#17,082 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
java
Domain
documentation

Research direction

Open docs/docs/evolution.md around line 96 and compare the replaceSortOrder example with api/src/main/java/org/apache/iceberg/SortOrderBuilder.java and NullOrder.java. Verify the corrected example against the API, then confirm the code block no longer contains the reported compilation errors.

Written by the indexing model from the issue text.

Description

Apache Iceberg version
main @ 49b89a8c5

Query engine
None (Java API)

Please describe the bug
The replaceSortOrder example in docs/docs/evolution.md (line 96) calls .dec("category", NullOrder.NULL_FIRST). Neither exists in the API: SortOrderBuilder (api/src/main/java/org/apache/iceberg/SortOrderBuilder.java) only defines desc(...), not dec(...), and NullOrder (api/src/main/java/org/apache/iceberg/NullOrder.java line 22-23) only defines the constants NULLS_FIRST/NULLS_LAST, not NULL_FIRST. The example does not compile as written. The line directly above it (.asc("id", NullOrder.NULLS_LAST)) already uses the correct constant naming, so only the second line has the typo.

Steps to reproduce
Copy the example code block from docs/docs/evolution.md line 93-97 into a Java file and compile it: fails with "cannot find symbol" for both dec and NULL_FIRST.

Additional context
N/A.

Dominant language
Java
Stars
9.3k
Forks
3.5k
Avg merge
2d 11h
Merged PRs (30d)
143

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg

All issues in apache/iceberg

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.