Skip to content

Conversation

@jackye1995
Copy link
Contributor

No description provided.

@github-actions github-actions bot added enhancement New feature or request java labels Nov 21, 2025
@jackye1995 jackye1995 marked this pull request as draft November 21, 2025 03:52
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Contributor

@majin1102 majin1102 left a comment

Choose a reason for hiding this comment

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

Can't wait to see these refactorings.

I Left a few commens, PTAL

}

/**
* Sets whether to ignore storage options from the namespace's describe_table() or
Copy link
Contributor

@majin1102 majin1102 Nov 21, 2025

Choose a reason for hiding this comment

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

Should we use DescribeTable/describeTable and CreateEmptyTable/createEmptyTable?

/**
* Sets the schema for the dataset.
*
* <p>If not provided, the schema will be inferred from the reader.
Copy link
Contributor

@majin1102 majin1102 Nov 21, 2025

Choose a reason for hiding this comment

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

I guess the comment should be 'If the reader and stream not provided, use the schema to create an empty dataset'? (get from code below)

private void validate() {
Preconditions.checkNotNull(datasetUri, "datasetUri is required");
Preconditions.checkState(
vectorSchemaRoot != null || arrowArrayStream != null,
Copy link
Contributor

Choose a reason for hiding this comment

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

If vectorSchemaRoot != null && arrowArrayStream != null, it seems arrowArrayStream would be ignored. Shall we validate it?

@jackye1995 jackye1995 marked this pull request as ready for review November 21, 2025 21:36
@jackye1995 jackye1995 requested a review from majin1102 November 21, 2025 21:36
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +387 to +393
// Build WriteParams with merged storage options
WriteParams.Builder paramsBuilder =
new WriteParams.Builder().withMode(mode).withStorageOptions(mergedStorageOptions);

maxRowsPerFile.ifPresent(paramsBuilder::withMaxRowsPerFile);

Choose a reason for hiding this comment

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

P1 Badge Namespace writes ignore credential provider

In the namespace write path the builder merges namespace storage options and builds WriteParams (lines 387‑391) but never attaches a StorageOptionsProvider the way OpenDatasetBuilder does for reads. When a namespace vend temporary credentials (e.g., with a short expires_at_millis), long-running writes through this builder will keep using the initial, soon-to-expire options and cannot refresh them, causing write failures once the credentials expire despite the new credential‑vending support.

Useful? React with 👍 / 👎.

Copy link
Contributor

@majin1102 majin1102 left a comment

Choose a reason for hiding this comment

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

Looks good to me, left a nit comment

extract_storage_options(env, storage_options_obj)?;

// Extract storage options provider if present
let storage_options_provider = if !storage_options_provider_obj.is_null() {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: It's fine to extract optional struct like this. I think this util method could make it simpler:

fn get_optional<T, F>(&mut self, obj: &JObject, f: F) -> Result<Option<T>>
where
F: FnOnce(&mut JNIEnv, &JObject) -> Result<T>;

@jackye1995 jackye1995 merged commit 2e8583d into lance-format:main Nov 25, 2025
20 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants