Skip to content

docs: add runnable examples for input_file_name() and file_row_index() - #24634

Open
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/examples_for_files
Open

docs: add runnable examples for input_file_name() and file_row_index()#24634
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/examples_for_files

Conversation

@alamb

@alamb alamb commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • N/A -- documentation only.

Rationale for this change

While writing a blog post

Which mentiones file_row_index() and input_file_name() -- I added a simple example for the post and I think it would help to have docs in the main site too.

What changes are included in this PR?

Replaces the sql_example with

> COPY (SELECT * from values (100), (200), (300)) to '/tmp/foo.parquet';

> select *, input_file_name(), file_row_index() from '/tmp/foo.parquet';
+---------+-------------------+------------------+
| column1 | input_file_name() | file_row_index() |
+---------+-------------------+------------------+
| 100     | tmp/foo.parquet   | 0                |
| 200     | tmp/foo.parquet   | 1                |
| 300     | tmp/foo.parquet   | 2                |
+---------+-------------------+------------------+

The same example is used for both functions, since showing them together is likely common and I think makes it clear what they do

Are these changes tested?

By CI

Are there any user-facing changes?

Yes, but documentation only -- the rendered examples for input_file_name()
and file_row_index() in the SQL function reference. No API or behavior
changes.

Both functions previously documented a placeholder example (`SELECT
input_file_name() FROM t;`) that showed no output and did not illustrate
that these functions are per-file metadata resolved during a file scan.

Replace them with a complete, verified example that writes a small
Parquet file and selects both functions alongside the data columns.
@github-actions github-actions Bot added documentation Improvements or additions to documentation functions Changes to functions implementation labels Aug 24, 2026
@alamb
alamb marked this pull request as ready for review August 24, 2026 19:10
@alamb
alamb requested a review from AdamGS August 24, 2026 19:10
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.43%. Comparing base (26b40dd) to head (cdc8928).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #24634   +/-   ##
=======================================
  Coverage   81.43%   81.43%           
=======================================
  Files        1118     1118           
  Lines      399414   399414           
  Branches   399414   399414           
=======================================
  Hits       325278   325278           
+ Misses      55145    55141    -4     
- Partials    18991    18995    +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AdamGS AdamGS 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 🙏

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

Labels

documentation Improvements or additions to documentation functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants