From 13f71b97caa26787afff8003de048ca090ea64cc Mon Sep 17 00:00:00 2001 From: Will Jones Date: Thu, 4 Jun 2026 10:12:55 -0700 Subject: [PATCH 1/3] feat: enrich IndexContent with describe_indices metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ListTableIndices returns IndexContent with only index_name, index_uuid, columns, and status. Consumers needing an index's type, size, or row count had to follow up with one DescribeTableIndexStats call per index — an N+1. Add the metadata that describe_indices exposes cheaply from the manifest to IndexContent: index_type, type_url, num_indexed_rows, size_bytes, num_segments, created_at, index_version, and index_details. All fields are optional for backwards compatibility with older servers. Regenerate the rust, python, and java clients from the updated spec. Closes #348 --- docs/src/spec.yaml | 47 +++ .../api/openapi.yaml | 66 +++ .../docs/IndexContent.md | 8 + .../lance/namespace/model/IndexContent.java | 388 +++++++++++++++++- .../api/openapi.yaml | 66 +++ .../docs/IndexContent.md | 8 + .../lance/namespace/model/IndexContent.java | 317 +++++++++++++- .../server/springboot/api/TableApi.java | 2 +- .../server/springboot/model/IndexContent.java | 245 ++++++++++- .../docs/IndexContent.md | 8 + .../models/index_content.py | 24 +- .../test/test_index_content.py | 10 +- .../test/test_list_table_indices_response.py | 20 +- .../docs/IndexContent.md | 8 + .../src/models/index_content.rs | 32 ++ 15 files changed, 1234 insertions(+), 15 deletions(-) diff --git a/docs/src/spec.yaml b/docs/src/spec.yaml index e0c27c1a5..76f99a000 100644 --- a/docs/src/spec.yaml +++ b/docs/src/spec.yaml @@ -3219,6 +3219,53 @@ components: status: type: string description: Current status of the index + index_type: + type: string + description: >- + Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin + recognizes the index. + type_url: + type: string + description: Protobuf type URL, a precise type identifier for the index. + num_indexed_rows: + type: integer + format: int64 + minimum: 0 + description: >- + Approximate number of rows covered by the index. May include + deleted rows. + size_bytes: + type: integer + format: int64 + minimum: 0 + nullable: true + description: >- + Total index size in bytes across all segments. Null for indices + predating file-size tracking. + num_segments: + type: integer + format: int32 + minimum: 0 + description: Number of index deltas/segments. + created_at: + type: string + format: date-time + nullable: true + description: >- + Earliest creation time across the index segments. Null for legacy + indices. + index_version: + type: integer + format: int32 + minimum: 0 + description: On-disk index format version. + index_details: + type: string + nullable: true + description: >- + Opaque, type-specific JSON with additional index details. For vector + indices this carries metric/distance type, partitioning, and + HNSW/PQ/SQ/RQ parameters. DescribeTableIndexStatsRequest: type: object diff --git a/java/lance-namespace-apache-client/api/openapi.yaml b/java/lance-namespace-apache-client/api/openapi.yaml index 540061725..7521e09d0 100644 --- a/java/lance-namespace-apache-client/api/openapi.yaml +++ b/java/lance-namespace-apache-client/api/openapi.yaml @@ -4469,17 +4469,33 @@ components: example: indexes: - index_uuid: index_uuid + index_version: 0 + size_bytes: 0 columns: - columns - columns + created_at: 2000-01-23T04:56:07.000+00:00 + index_details: index_details + num_indexed_rows: 0 index_name: index_name + num_segments: 0 status: status + index_type: index_type + type_url: type_url - index_uuid: index_uuid + index_version: 0 + size_bytes: 0 columns: - columns - columns + created_at: 2000-01-23T04:56:07.000+00:00 + index_details: index_details + num_indexed_rows: 0 index_name: index_name + num_segments: 0 status: status + index_type: index_type + type_url: type_url page_token: page_token properties: indexes: @@ -4511,11 +4527,19 @@ components: IndexContent: example: index_uuid: index_uuid + index_version: 0 + size_bytes: 0 columns: - columns - columns + created_at: 2000-01-23T04:56:07.000+00:00 + index_details: index_details + num_indexed_rows: 0 index_name: index_name + num_segments: 0 status: status + index_type: index_type + type_url: type_url properties: index_name: description: Name of the index @@ -4531,6 +4555,48 @@ components: status: description: Current status of the index type: string + index_type: + description: "Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin\ + \ recognizes the index." + type: string + type_url: + description: "Protobuf type URL, a precise type identifier for the index." + type: string + num_indexed_rows: + description: Approximate number of rows covered by the index. May include + deleted rows. + format: int64 + minimum: 0 + type: integer + size_bytes: + description: Total index size in bytes across all segments. Null for indices + predating file-size tracking. + format: int64 + minimum: 0 + type: integer + nullable: true + num_segments: + description: Number of index deltas/segments. + format: int32 + minimum: 0 + type: integer + created_at: + description: Earliest creation time across the index segments. Null for + legacy indices. + format: date-time + type: string + nullable: true + index_version: + description: On-disk index format version. + format: int32 + minimum: 0 + type: integer + index_details: + description: "Opaque, type-specific JSON with additional index details.\ + \ For vector indices this carries metric/distance type, partitioning,\ + \ and HNSW/PQ/SQ/RQ parameters." + type: string + nullable: true required: - columns - index_name diff --git a/java/lance-namespace-apache-client/docs/IndexContent.md b/java/lance-namespace-apache-client/docs/IndexContent.md index 131589588..3c9bdaf9a 100644 --- a/java/lance-namespace-apache-client/docs/IndexContent.md +++ b/java/lance-namespace-apache-client/docs/IndexContent.md @@ -11,6 +11,14 @@ |**indexUuid** | **String** | Unique identifier for the index | | |**columns** | **List<String>** | Columns covered by this index | | |**status** | **String** | Current status of the index | | +|**indexType** | **String** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] | +|**typeUrl** | **String** | Protobuf type URL, a precise type identifier for the index. | [optional] | +|**numIndexedRows** | **Long** | Approximate number of rows covered by the index. May include deleted rows. | [optional] | +|**sizeBytes** | **Long** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] | +|**numSegments** | **Integer** | Number of index deltas/segments. | [optional] | +|**createdAt** | **OffsetDateTime** | Earliest creation time across the index segments. Null for legacy indices. | [optional] | +|**indexVersion** | **Integer** | On-disk index format version. | [optional] | +|**indexDetails** | **String** | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] | diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java index cf8e0a3f6..e4a19ebad 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java @@ -19,6 +19,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -29,7 +30,15 @@ IndexContent.JSON_PROPERTY_INDEX_NAME, IndexContent.JSON_PROPERTY_INDEX_UUID, IndexContent.JSON_PROPERTY_COLUMNS, - IndexContent.JSON_PROPERTY_STATUS + IndexContent.JSON_PROPERTY_STATUS, + IndexContent.JSON_PROPERTY_INDEX_TYPE, + IndexContent.JSON_PROPERTY_TYPE_URL, + IndexContent.JSON_PROPERTY_NUM_INDEXED_ROWS, + IndexContent.JSON_PROPERTY_SIZE_BYTES, + IndexContent.JSON_PROPERTY_NUM_SEGMENTS, + IndexContent.JSON_PROPERTY_CREATED_AT, + IndexContent.JSON_PROPERTY_INDEX_VERSION, + IndexContent.JSON_PROPERTY_INDEX_DETAILS }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -47,6 +56,30 @@ public class IndexContent { public static final String JSON_PROPERTY_STATUS = "status"; @javax.annotation.Nonnull private String status; + public static final String JSON_PROPERTY_INDEX_TYPE = "index_type"; + @javax.annotation.Nullable private String indexType; + + public static final String JSON_PROPERTY_TYPE_URL = "type_url"; + @javax.annotation.Nullable private String typeUrl; + + public static final String JSON_PROPERTY_NUM_INDEXED_ROWS = "num_indexed_rows"; + @javax.annotation.Nullable private Long numIndexedRows; + + public static final String JSON_PROPERTY_SIZE_BYTES = "size_bytes"; + @javax.annotation.Nullable private Long sizeBytes; + + public static final String JSON_PROPERTY_NUM_SEGMENTS = "num_segments"; + @javax.annotation.Nullable private Integer numSegments; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @javax.annotation.Nullable private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_INDEX_VERSION = "index_version"; + @javax.annotation.Nullable private Integer indexVersion; + + public static final String JSON_PROPERTY_INDEX_DETAILS = "index_details"; + @javax.annotation.Nullable private String indexDetails; + public IndexContent() {} public IndexContent indexName(@javax.annotation.Nonnull String indexName) { @@ -153,6 +186,200 @@ public void setStatus(@javax.annotation.Nonnull String status) { this.status = status; } + public IndexContent indexType(@javax.annotation.Nullable String indexType) { + + this.indexType = indexType; + return this; + } + + /** + * Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. + * + * @return indexType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexType() { + return indexType; + } + + @JsonProperty(JSON_PROPERTY_INDEX_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexType(@javax.annotation.Nullable String indexType) { + this.indexType = indexType; + } + + public IndexContent typeUrl(@javax.annotation.Nullable String typeUrl) { + + this.typeUrl = typeUrl; + return this; + } + + /** + * Protobuf type URL, a precise type identifier for the index. + * + * @return typeUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTypeUrl() { + return typeUrl; + } + + @JsonProperty(JSON_PROPERTY_TYPE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTypeUrl(@javax.annotation.Nullable String typeUrl) { + this.typeUrl = typeUrl; + } + + public IndexContent numIndexedRows(@javax.annotation.Nullable Long numIndexedRows) { + + this.numIndexedRows = numIndexedRows; + return this; + } + + /** + * Approximate number of rows covered by the index. May include deleted rows. minimum: 0 + * + * @return numIndexedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_INDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumIndexedRows() { + return numIndexedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_INDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumIndexedRows(@javax.annotation.Nullable Long numIndexedRows) { + this.numIndexedRows = numIndexedRows; + } + + public IndexContent sizeBytes(@javax.annotation.Nullable Long sizeBytes) { + + this.sizeBytes = sizeBytes; + return this; + } + + /** + * Total index size in bytes across all segments. Null for indices predating file-size tracking. + * minimum: 0 + * + * @return sizeBytes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE_BYTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSizeBytes() { + return sizeBytes; + } + + @JsonProperty(JSON_PROPERTY_SIZE_BYTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSizeBytes(@javax.annotation.Nullable Long sizeBytes) { + this.sizeBytes = sizeBytes; + } + + public IndexContent numSegments(@javax.annotation.Nullable Integer numSegments) { + + this.numSegments = numSegments; + return this; + } + + /** + * Number of index deltas/segments. minimum: 0 + * + * @return numSegments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumSegments() { + return numSegments; + } + + @JsonProperty(JSON_PROPERTY_NUM_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumSegments(@javax.annotation.Nullable Integer numSegments) { + this.numSegments = numSegments; + } + + public IndexContent createdAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Earliest creation time across the index segments. Null for legacy indices. + * + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public IndexContent indexVersion(@javax.annotation.Nullable Integer indexVersion) { + + this.indexVersion = indexVersion; + return this; + } + + /** + * On-disk index format version. minimum: 0 + * + * @return indexVersion + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexVersion() { + return indexVersion; + } + + @JsonProperty(JSON_PROPERTY_INDEX_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexVersion(@javax.annotation.Nullable Integer indexVersion) { + this.indexVersion = indexVersion; + } + + public IndexContent indexDetails(@javax.annotation.Nullable String indexDetails) { + + this.indexDetails = indexDetails; + return this; + } + + /** + * Opaque, type-specific JSON with additional index details. For vector indices this carries + * metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. + * + * @return indexDetails + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexDetails() { + return indexDetails; + } + + @JsonProperty(JSON_PROPERTY_INDEX_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexDetails(@javax.annotation.Nullable String indexDetails) { + this.indexDetails = indexDetails; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -165,12 +392,32 @@ public boolean equals(Object o) { return Objects.equals(this.indexName, indexContent.indexName) && Objects.equals(this.indexUuid, indexContent.indexUuid) && Objects.equals(this.columns, indexContent.columns) - && Objects.equals(this.status, indexContent.status); + && Objects.equals(this.status, indexContent.status) + && Objects.equals(this.indexType, indexContent.indexType) + && Objects.equals(this.typeUrl, indexContent.typeUrl) + && Objects.equals(this.numIndexedRows, indexContent.numIndexedRows) + && Objects.equals(this.sizeBytes, indexContent.sizeBytes) + && Objects.equals(this.numSegments, indexContent.numSegments) + && Objects.equals(this.createdAt, indexContent.createdAt) + && Objects.equals(this.indexVersion, indexContent.indexVersion) + && Objects.equals(this.indexDetails, indexContent.indexDetails); } @Override public int hashCode() { - return Objects.hash(indexName, indexUuid, columns, status); + return Objects.hash( + indexName, + indexUuid, + columns, + status, + indexType, + typeUrl, + numIndexedRows, + sizeBytes, + numSegments, + createdAt, + indexVersion, + indexDetails); } @Override @@ -181,6 +428,14 @@ public String toString() { sb.append(" indexUuid: ").append(toIndentedString(indexUuid)).append("\n"); sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" indexType: ").append(toIndentedString(indexType)).append("\n"); + sb.append(" typeUrl: ").append(toIndentedString(typeUrl)).append("\n"); + sb.append(" numIndexedRows: ").append(toIndentedString(numIndexedRows)).append("\n"); + sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); + sb.append(" numSegments: ").append(toIndentedString(numSegments)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" indexVersion: ").append(toIndentedString(indexVersion)).append("\n"); + sb.append(" indexDetails: ").append(toIndentedString(indexDetails)).append("\n"); sb.append("}"); return sb.toString(); } @@ -295,6 +550,133 @@ public String toUrlQueryString(String prefix) { } } + // add `index_type` to the URL query string + if (getIndexType() != null) { + try { + joiner.add( + String.format( + "%sindex_type%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getIndexType()), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type_url` to the URL query string + if (getTypeUrl() != null) { + try { + joiner.add( + String.format( + "%stype_url%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getTypeUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `num_indexed_rows` to the URL query string + if (getNumIndexedRows() != null) { + try { + joiner.add( + String.format( + "%snum_indexed_rows%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getNumIndexedRows()), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `size_bytes` to the URL query string + if (getSizeBytes() != null) { + try { + joiner.add( + String.format( + "%ssize_bytes%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getSizeBytes()), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `num_segments` to the URL query string + if (getNumSegments() != null) { + try { + joiner.add( + String.format( + "%snum_segments%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getNumSegments()), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add( + String.format( + "%screated_at%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `index_version` to the URL query string + if (getIndexVersion() != null) { + try { + joiner.add( + String.format( + "%sindex_version%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getIndexVersion()), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `index_details` to the URL query string + if (getIndexDetails() != null) { + try { + joiner.add( + String.format( + "%sindex_details%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getIndexDetails()), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + return joiner.toString(); } } diff --git a/java/lance-namespace-async-client/api/openapi.yaml b/java/lance-namespace-async-client/api/openapi.yaml index 540061725..7521e09d0 100644 --- a/java/lance-namespace-async-client/api/openapi.yaml +++ b/java/lance-namespace-async-client/api/openapi.yaml @@ -4469,17 +4469,33 @@ components: example: indexes: - index_uuid: index_uuid + index_version: 0 + size_bytes: 0 columns: - columns - columns + created_at: 2000-01-23T04:56:07.000+00:00 + index_details: index_details + num_indexed_rows: 0 index_name: index_name + num_segments: 0 status: status + index_type: index_type + type_url: type_url - index_uuid: index_uuid + index_version: 0 + size_bytes: 0 columns: - columns - columns + created_at: 2000-01-23T04:56:07.000+00:00 + index_details: index_details + num_indexed_rows: 0 index_name: index_name + num_segments: 0 status: status + index_type: index_type + type_url: type_url page_token: page_token properties: indexes: @@ -4511,11 +4527,19 @@ components: IndexContent: example: index_uuid: index_uuid + index_version: 0 + size_bytes: 0 columns: - columns - columns + created_at: 2000-01-23T04:56:07.000+00:00 + index_details: index_details + num_indexed_rows: 0 index_name: index_name + num_segments: 0 status: status + index_type: index_type + type_url: type_url properties: index_name: description: Name of the index @@ -4531,6 +4555,48 @@ components: status: description: Current status of the index type: string + index_type: + description: "Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin\ + \ recognizes the index." + type: string + type_url: + description: "Protobuf type URL, a precise type identifier for the index." + type: string + num_indexed_rows: + description: Approximate number of rows covered by the index. May include + deleted rows. + format: int64 + minimum: 0 + type: integer + size_bytes: + description: Total index size in bytes across all segments. Null for indices + predating file-size tracking. + format: int64 + minimum: 0 + type: integer + nullable: true + num_segments: + description: Number of index deltas/segments. + format: int32 + minimum: 0 + type: integer + created_at: + description: Earliest creation time across the index segments. Null for + legacy indices. + format: date-time + type: string + nullable: true + index_version: + description: On-disk index format version. + format: int32 + minimum: 0 + type: integer + index_details: + description: "Opaque, type-specific JSON with additional index details.\ + \ For vector indices this carries metric/distance type, partitioning,\ + \ and HNSW/PQ/SQ/RQ parameters." + type: string + nullable: true required: - columns - index_name diff --git a/java/lance-namespace-async-client/docs/IndexContent.md b/java/lance-namespace-async-client/docs/IndexContent.md index 131589588..3c9bdaf9a 100644 --- a/java/lance-namespace-async-client/docs/IndexContent.md +++ b/java/lance-namespace-async-client/docs/IndexContent.md @@ -11,6 +11,14 @@ |**indexUuid** | **String** | Unique identifier for the index | | |**columns** | **List<String>** | Columns covered by this index | | |**status** | **String** | Current status of the index | | +|**indexType** | **String** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] | +|**typeUrl** | **String** | Protobuf type URL, a precise type identifier for the index. | [optional] | +|**numIndexedRows** | **Long** | Approximate number of rows covered by the index. May include deleted rows. | [optional] | +|**sizeBytes** | **Long** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] | +|**numSegments** | **Integer** | Number of index deltas/segments. | [optional] | +|**createdAt** | **OffsetDateTime** | Earliest creation time across the index segments. Null for legacy indices. | [optional] | +|**indexVersion** | **Integer** | On-disk index format version. | [optional] | +|**indexDetails** | **String** | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] | diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java index c7d100274..b2f849940 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -29,7 +30,15 @@ IndexContent.JSON_PROPERTY_INDEX_NAME, IndexContent.JSON_PROPERTY_INDEX_UUID, IndexContent.JSON_PROPERTY_COLUMNS, - IndexContent.JSON_PROPERTY_STATUS + IndexContent.JSON_PROPERTY_STATUS, + IndexContent.JSON_PROPERTY_INDEX_TYPE, + IndexContent.JSON_PROPERTY_TYPE_URL, + IndexContent.JSON_PROPERTY_NUM_INDEXED_ROWS, + IndexContent.JSON_PROPERTY_SIZE_BYTES, + IndexContent.JSON_PROPERTY_NUM_SEGMENTS, + IndexContent.JSON_PROPERTY_CREATED_AT, + IndexContent.JSON_PROPERTY_INDEX_VERSION, + IndexContent.JSON_PROPERTY_INDEX_DETAILS }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -47,6 +56,30 @@ public class IndexContent { public static final String JSON_PROPERTY_STATUS = "status"; @javax.annotation.Nonnull private String status; + public static final String JSON_PROPERTY_INDEX_TYPE = "index_type"; + @javax.annotation.Nullable private String indexType; + + public static final String JSON_PROPERTY_TYPE_URL = "type_url"; + @javax.annotation.Nullable private String typeUrl; + + public static final String JSON_PROPERTY_NUM_INDEXED_ROWS = "num_indexed_rows"; + @javax.annotation.Nullable private Long numIndexedRows; + + public static final String JSON_PROPERTY_SIZE_BYTES = "size_bytes"; + @javax.annotation.Nullable private Long sizeBytes; + + public static final String JSON_PROPERTY_NUM_SEGMENTS = "num_segments"; + @javax.annotation.Nullable private Integer numSegments; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @javax.annotation.Nullable private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_INDEX_VERSION = "index_version"; + @javax.annotation.Nullable private Integer indexVersion; + + public static final String JSON_PROPERTY_INDEX_DETAILS = "index_details"; + @javax.annotation.Nullable private String indexDetails; + public IndexContent() {} public IndexContent indexName(@javax.annotation.Nonnull String indexName) { @@ -149,6 +182,192 @@ public void setStatus(@javax.annotation.Nonnull String status) { this.status = status; } + public IndexContent indexType(@javax.annotation.Nullable String indexType) { + this.indexType = indexType; + return this; + } + + /** + * Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. + * + * @return indexType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexType() { + return indexType; + } + + @JsonProperty(JSON_PROPERTY_INDEX_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexType(@javax.annotation.Nullable String indexType) { + this.indexType = indexType; + } + + public IndexContent typeUrl(@javax.annotation.Nullable String typeUrl) { + this.typeUrl = typeUrl; + return this; + } + + /** + * Protobuf type URL, a precise type identifier for the index. + * + * @return typeUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTypeUrl() { + return typeUrl; + } + + @JsonProperty(JSON_PROPERTY_TYPE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTypeUrl(@javax.annotation.Nullable String typeUrl) { + this.typeUrl = typeUrl; + } + + public IndexContent numIndexedRows(@javax.annotation.Nullable Long numIndexedRows) { + this.numIndexedRows = numIndexedRows; + return this; + } + + /** + * Approximate number of rows covered by the index. May include deleted rows. minimum: 0 + * + * @return numIndexedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_INDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumIndexedRows() { + return numIndexedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_INDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumIndexedRows(@javax.annotation.Nullable Long numIndexedRows) { + this.numIndexedRows = numIndexedRows; + } + + public IndexContent sizeBytes(@javax.annotation.Nullable Long sizeBytes) { + this.sizeBytes = sizeBytes; + return this; + } + + /** + * Total index size in bytes across all segments. Null for indices predating file-size tracking. + * minimum: 0 + * + * @return sizeBytes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE_BYTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSizeBytes() { + return sizeBytes; + } + + @JsonProperty(JSON_PROPERTY_SIZE_BYTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSizeBytes(@javax.annotation.Nullable Long sizeBytes) { + this.sizeBytes = sizeBytes; + } + + public IndexContent numSegments(@javax.annotation.Nullable Integer numSegments) { + this.numSegments = numSegments; + return this; + } + + /** + * Number of index deltas/segments. minimum: 0 + * + * @return numSegments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumSegments() { + return numSegments; + } + + @JsonProperty(JSON_PROPERTY_NUM_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumSegments(@javax.annotation.Nullable Integer numSegments) { + this.numSegments = numSegments; + } + + public IndexContent createdAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Earliest creation time across the index segments. Null for legacy indices. + * + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public IndexContent indexVersion(@javax.annotation.Nullable Integer indexVersion) { + this.indexVersion = indexVersion; + return this; + } + + /** + * On-disk index format version. minimum: 0 + * + * @return indexVersion + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexVersion() { + return indexVersion; + } + + @JsonProperty(JSON_PROPERTY_INDEX_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexVersion(@javax.annotation.Nullable Integer indexVersion) { + this.indexVersion = indexVersion; + } + + public IndexContent indexDetails(@javax.annotation.Nullable String indexDetails) { + this.indexDetails = indexDetails; + return this; + } + + /** + * Opaque, type-specific JSON with additional index details. For vector indices this carries + * metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. + * + * @return indexDetails + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexDetails() { + return indexDetails; + } + + @JsonProperty(JSON_PROPERTY_INDEX_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexDetails(@javax.annotation.Nullable String indexDetails) { + this.indexDetails = indexDetails; + } + /** Return true if this IndexContent object is equal to o. */ @Override public boolean equals(Object o) { @@ -162,12 +381,32 @@ public boolean equals(Object o) { return Objects.equals(this.indexName, indexContent.indexName) && Objects.equals(this.indexUuid, indexContent.indexUuid) && Objects.equals(this.columns, indexContent.columns) - && Objects.equals(this.status, indexContent.status); + && Objects.equals(this.status, indexContent.status) + && Objects.equals(this.indexType, indexContent.indexType) + && Objects.equals(this.typeUrl, indexContent.typeUrl) + && Objects.equals(this.numIndexedRows, indexContent.numIndexedRows) + && Objects.equals(this.sizeBytes, indexContent.sizeBytes) + && Objects.equals(this.numSegments, indexContent.numSegments) + && Objects.equals(this.createdAt, indexContent.createdAt) + && Objects.equals(this.indexVersion, indexContent.indexVersion) + && Objects.equals(this.indexDetails, indexContent.indexDetails); } @Override public int hashCode() { - return Objects.hash(indexName, indexUuid, columns, status); + return Objects.hash( + indexName, + indexUuid, + columns, + status, + indexType, + typeUrl, + numIndexedRows, + sizeBytes, + numSegments, + createdAt, + indexVersion, + indexDetails); } @Override @@ -178,6 +417,14 @@ public String toString() { sb.append(" indexUuid: ").append(toIndentedString(indexUuid)).append("\n"); sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" indexType: ").append(toIndentedString(indexType)).append("\n"); + sb.append(" typeUrl: ").append(toIndentedString(typeUrl)).append("\n"); + sb.append(" numIndexedRows: ").append(toIndentedString(numIndexedRows)).append("\n"); + sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); + sb.append(" numSegments: ").append(toIndentedString(numSegments)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" indexVersion: ").append(toIndentedString(indexVersion)).append("\n"); + sb.append(" indexDetails: ").append(toIndentedString(indexDetails)).append("\n"); sb.append("}"); return sb.toString(); } @@ -263,6 +510,70 @@ public String toUrlQueryString(String prefix) { prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); } + // add `index_type` to the URL query string + if (getIndexType() != null) { + joiner.add( + String.format( + "%sindex_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexType())))); + } + + // add `type_url` to the URL query string + if (getTypeUrl() != null) { + joiner.add( + String.format( + "%stype_url%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTypeUrl())))); + } + + // add `num_indexed_rows` to the URL query string + if (getNumIndexedRows() != null) { + joiner.add( + String.format( + "%snum_indexed_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumIndexedRows())))); + } + + // add `size_bytes` to the URL query string + if (getSizeBytes() != null) { + joiner.add( + String.format( + "%ssize_bytes%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSizeBytes())))); + } + + // add `num_segments` to the URL query string + if (getNumSegments() != null) { + joiner.add( + String.format( + "%snum_segments%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumSegments())))); + } + + // add `created_at` to the URL query string + if (getCreatedAt() != null) { + joiner.add( + String.format( + "%screated_at%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedAt())))); + } + + // add `index_version` to the URL query string + if (getIndexVersion() != null) { + joiner.add( + String.format( + "%sindex_version%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexVersion())))); + } + + // add `index_details` to the URL query string + if (getIndexDetails() != null) { + joiner.add( + String.format( + "%sindex_details%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexDetails())))); + } + return joiner.toString(); } } diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java index 8c608ba94..90fa0ffe7 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java @@ -5318,7 +5318,7 @@ default ResponseEntity listTableIndices( for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = - "{ \"indexes\" : [ { \"index_uuid\" : \"index_uuid\", \"columns\" : [ \"columns\", \"columns\" ], \"index_name\" : \"index_name\", \"status\" : \"status\" }, { \"index_uuid\" : \"index_uuid\", \"columns\" : [ \"columns\", \"columns\" ], \"index_name\" : \"index_name\", \"status\" : \"status\" } ], \"page_token\" : \"page_token\" }"; + "{ \"indexes\" : [ { \"index_uuid\" : \"index_uuid\", \"index_version\" : 0, \"size_bytes\" : 0, \"columns\" : [ \"columns\", \"columns\" ], \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"index_details\" : \"index_details\", \"num_indexed_rows\" : 0, \"index_name\" : \"index_name\", \"num_segments\" : 0, \"status\" : \"status\", \"index_type\" : \"index_type\", \"type_url\" : \"type_url\" }, { \"index_uuid\" : \"index_uuid\", \"index_version\" : 0, \"size_bytes\" : 0, \"columns\" : [ \"columns\", \"columns\" ], \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"index_details\" : \"index_details\", \"num_indexed_rows\" : 0, \"index_name\" : \"index_name\", \"num_segments\" : 0, \"status\" : \"status\", \"index_type\" : \"index_type\", \"type_url\" : \"type_url\" } ], \"page_token\" : \"page_token\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java index 89728296f..0f7a8f82a 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java @@ -18,7 +18,9 @@ import jakarta.annotation.Generated; import jakarta.validation.Valid; import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.OffsetDateTime; import java.util.*; import java.util.ArrayList; import java.util.List; @@ -38,6 +40,23 @@ public class IndexContent { private String status; + private String indexType; + + private String typeUrl; + + private Long numIndexedRows; + + private Long sizeBytes; + + private Integer numSegments; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime createdAt; + + private Integer indexVersion; + + private String indexDetails; + public IndexContent() { super(); } @@ -154,6 +173,200 @@ public void setStatus(String status) { this.status = status; } + public IndexContent indexType(String indexType) { + this.indexType = indexType; + return this; + } + + /** + * Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. + * + * @return indexType + */ + @Schema( + name = "index_type", + description = + "Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("index_type") + public String getIndexType() { + return indexType; + } + + public void setIndexType(String indexType) { + this.indexType = indexType; + } + + public IndexContent typeUrl(String typeUrl) { + this.typeUrl = typeUrl; + return this; + } + + /** + * Protobuf type URL, a precise type identifier for the index. + * + * @return typeUrl + */ + @Schema( + name = "type_url", + description = "Protobuf type URL, a precise type identifier for the index.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_url") + public String getTypeUrl() { + return typeUrl; + } + + public void setTypeUrl(String typeUrl) { + this.typeUrl = typeUrl; + } + + public IndexContent numIndexedRows(Long numIndexedRows) { + this.numIndexedRows = numIndexedRows; + return this; + } + + /** + * Approximate number of rows covered by the index. May include deleted rows. minimum: 0 + * + * @return numIndexedRows + */ + @Min(0L) + @Schema( + name = "num_indexed_rows", + description = "Approximate number of rows covered by the index. May include deleted rows.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("num_indexed_rows") + public Long getNumIndexedRows() { + return numIndexedRows; + } + + public void setNumIndexedRows(Long numIndexedRows) { + this.numIndexedRows = numIndexedRows; + } + + public IndexContent sizeBytes(Long sizeBytes) { + this.sizeBytes = sizeBytes; + return this; + } + + /** + * Total index size in bytes across all segments. Null for indices predating file-size tracking. + * minimum: 0 + * + * @return sizeBytes + */ + @Min(0L) + @Schema( + name = "size_bytes", + description = + "Total index size in bytes across all segments. Null for indices predating file-size tracking.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("size_bytes") + public Long getSizeBytes() { + return sizeBytes; + } + + public void setSizeBytes(Long sizeBytes) { + this.sizeBytes = sizeBytes; + } + + public IndexContent numSegments(Integer numSegments) { + this.numSegments = numSegments; + return this; + } + + /** + * Number of index deltas/segments. minimum: 0 + * + * @return numSegments + */ + @Min(0) + @Schema( + name = "num_segments", + description = "Number of index deltas/segments.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("num_segments") + public Integer getNumSegments() { + return numSegments; + } + + public void setNumSegments(Integer numSegments) { + this.numSegments = numSegments; + } + + public IndexContent createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Earliest creation time across the index segments. Null for legacy indices. + * + * @return createdAt + */ + @Valid + @Schema( + name = "created_at", + description = "Earliest creation time across the index segments. Null for legacy indices.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public IndexContent indexVersion(Integer indexVersion) { + this.indexVersion = indexVersion; + return this; + } + + /** + * On-disk index format version. minimum: 0 + * + * @return indexVersion + */ + @Min(0) + @Schema( + name = "index_version", + description = "On-disk index format version.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("index_version") + public Integer getIndexVersion() { + return indexVersion; + } + + public void setIndexVersion(Integer indexVersion) { + this.indexVersion = indexVersion; + } + + public IndexContent indexDetails(String indexDetails) { + this.indexDetails = indexDetails; + return this; + } + + /** + * Opaque, type-specific JSON with additional index details. For vector indices this carries + * metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. + * + * @return indexDetails + */ + @Schema( + name = "index_details", + description = + "Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("index_details") + public String getIndexDetails() { + return indexDetails; + } + + public void setIndexDetails(String indexDetails) { + this.indexDetails = indexDetails; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -166,12 +379,32 @@ public boolean equals(Object o) { return Objects.equals(this.indexName, indexContent.indexName) && Objects.equals(this.indexUuid, indexContent.indexUuid) && Objects.equals(this.columns, indexContent.columns) - && Objects.equals(this.status, indexContent.status); + && Objects.equals(this.status, indexContent.status) + && Objects.equals(this.indexType, indexContent.indexType) + && Objects.equals(this.typeUrl, indexContent.typeUrl) + && Objects.equals(this.numIndexedRows, indexContent.numIndexedRows) + && Objects.equals(this.sizeBytes, indexContent.sizeBytes) + && Objects.equals(this.numSegments, indexContent.numSegments) + && Objects.equals(this.createdAt, indexContent.createdAt) + && Objects.equals(this.indexVersion, indexContent.indexVersion) + && Objects.equals(this.indexDetails, indexContent.indexDetails); } @Override public int hashCode() { - return Objects.hash(indexName, indexUuid, columns, status); + return Objects.hash( + indexName, + indexUuid, + columns, + status, + indexType, + typeUrl, + numIndexedRows, + sizeBytes, + numSegments, + createdAt, + indexVersion, + indexDetails); } @Override @@ -182,6 +415,14 @@ public String toString() { sb.append(" indexUuid: ").append(toIndentedString(indexUuid)).append("\n"); sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" indexType: ").append(toIndentedString(indexType)).append("\n"); + sb.append(" typeUrl: ").append(toIndentedString(typeUrl)).append("\n"); + sb.append(" numIndexedRows: ").append(toIndentedString(numIndexedRows)).append("\n"); + sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); + sb.append(" numSegments: ").append(toIndentedString(numSegments)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" indexVersion: ").append(toIndentedString(indexVersion)).append("\n"); + sb.append(" indexDetails: ").append(toIndentedString(indexDetails)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/python/lance_namespace_urllib3_client/docs/IndexContent.md b/python/lance_namespace_urllib3_client/docs/IndexContent.md index 94aad07a7..3b29eb28a 100644 --- a/python/lance_namespace_urllib3_client/docs/IndexContent.md +++ b/python/lance_namespace_urllib3_client/docs/IndexContent.md @@ -9,6 +9,14 @@ Name | Type | Description | Notes **index_uuid** | **str** | Unique identifier for the index | **columns** | **List[str]** | Columns covered by this index | **status** | **str** | Current status of the index | +**index_type** | **str** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] +**type_url** | **str** | Protobuf type URL, a precise type identifier for the index. | [optional] +**num_indexed_rows** | **int** | Approximate number of rows covered by the index. May include deleted rows. | [optional] +**size_bytes** | **int** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] +**num_segments** | **int** | Number of index deltas/segments. | [optional] +**created_at** | **datetime** | Earliest creation time across the index segments. Null for legacy indices. | [optional] +**index_version** | **int** | On-disk index format version. | [optional] +**index_details** | **str** | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] ## Example diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py index d7190f5f2..29c07b087 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py @@ -17,8 +17,10 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,7 +32,15 @@ class IndexContent(BaseModel): index_uuid: StrictStr = Field(description="Unique identifier for the index") columns: List[StrictStr] = Field(description="Columns covered by this index") status: StrictStr = Field(description="Current status of the index") - __properties: ClassVar[List[str]] = ["index_name", "index_uuid", "columns", "status"] + index_type: Optional[StrictStr] = Field(default=None, description="Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index.") + type_url: Optional[StrictStr] = Field(default=None, description="Protobuf type URL, a precise type identifier for the index.") + num_indexed_rows: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Approximate number of rows covered by the index. May include deleted rows.") + size_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Total index size in bytes across all segments. Null for indices predating file-size tracking.") + num_segments: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Number of index deltas/segments.") + created_at: Optional[datetime] = Field(default=None, description="Earliest creation time across the index segments. Null for legacy indices.") + index_version: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="On-disk index format version.") + index_details: Optional[StrictStr] = Field(default=None, description="Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters.") + __properties: ClassVar[List[str]] = ["index_name", "index_uuid", "columns", "status", "index_type", "type_url", "num_indexed_rows", "size_bytes", "num_segments", "created_at", "index_version", "index_details"] model_config = ConfigDict( populate_by_name=True, @@ -86,7 +96,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "index_name": obj.get("index_name"), "index_uuid": obj.get("index_uuid"), "columns": obj.get("columns"), - "status": obj.get("status") + "status": obj.get("status"), + "index_type": obj.get("index_type"), + "type_url": obj.get("type_url"), + "num_indexed_rows": obj.get("num_indexed_rows"), + "size_bytes": obj.get("size_bytes"), + "num_segments": obj.get("num_segments"), + "created_at": obj.get("created_at"), + "index_version": obj.get("index_version"), + "index_details": obj.get("index_details") }) return _obj diff --git a/python/lance_namespace_urllib3_client/test/test_index_content.py b/python/lance_namespace_urllib3_client/test/test_index_content.py index efad2f1e1..b912c4a84 100644 --- a/python/lance_namespace_urllib3_client/test/test_index_content.py +++ b/python/lance_namespace_urllib3_client/test/test_index_content.py @@ -40,7 +40,15 @@ def make_instance(self, include_optional) -> IndexContent: columns = [ '' ], - status = '' + status = '', + index_type = '', + type_url = '', + num_indexed_rows = 0, + size_bytes = 0, + num_segments = 0, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + index_version = 0, + index_details = '' ) else: return IndexContent( diff --git a/python/lance_namespace_urllib3_client/test/test_list_table_indices_response.py b/python/lance_namespace_urllib3_client/test/test_list_table_indices_response.py index 9d346eeb9..877dc75e1 100644 --- a/python/lance_namespace_urllib3_client/test/test_list_table_indices_response.py +++ b/python/lance_namespace_urllib3_client/test/test_list_table_indices_response.py @@ -42,7 +42,15 @@ def make_instance(self, include_optional) -> ListTableIndicesResponse: columns = [ '' ], - status = '', ) + status = '', + index_type = '', + type_url = '', + num_indexed_rows = 0, + size_bytes = 0, + num_segments = 0, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + index_version = 0, + index_details = '', ) ], page_token = '' ) @@ -55,7 +63,15 @@ def make_instance(self, include_optional) -> ListTableIndicesResponse: columns = [ '' ], - status = '', ) + status = '', + index_type = '', + type_url = '', + num_indexed_rows = 0, + size_bytes = 0, + num_segments = 0, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + index_version = 0, + index_details = '', ) ], ) """ diff --git a/rust/lance-namespace-reqwest-client/docs/IndexContent.md b/rust/lance-namespace-reqwest-client/docs/IndexContent.md index 6fd9e2a4e..769bf0dc2 100644 --- a/rust/lance-namespace-reqwest-client/docs/IndexContent.md +++ b/rust/lance-namespace-reqwest-client/docs/IndexContent.md @@ -8,6 +8,14 @@ Name | Type | Description | Notes **index_uuid** | **String** | Unique identifier for the index | **columns** | **Vec** | Columns covered by this index | **status** | **String** | Current status of the index | +**index_type** | Option<**String**> | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] +**type_url** | Option<**String**> | Protobuf type URL, a precise type identifier for the index. | [optional] +**num_indexed_rows** | Option<**i64**> | Approximate number of rows covered by the index. May include deleted rows. | [optional] +**size_bytes** | Option<**i64**> | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] +**num_segments** | Option<**i32**> | Number of index deltas/segments. | [optional] +**created_at** | Option<**String**> | Earliest creation time across the index segments. Null for legacy indices. | [optional] +**index_version** | Option<**i32**> | On-disk index format version. | [optional] +**index_details** | Option<**String**> | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/rust/lance-namespace-reqwest-client/src/models/index_content.rs b/rust/lance-namespace-reqwest-client/src/models/index_content.rs index 36b0a31eb..14130243b 100644 --- a/rust/lance-namespace-reqwest-client/src/models/index_content.rs +++ b/rust/lance-namespace-reqwest-client/src/models/index_content.rs @@ -25,6 +25,30 @@ pub struct IndexContent { /// Current status of the index #[serde(rename = "status")] pub status: String, + /// Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. + #[serde(rename = "index_type", skip_serializing_if = "Option::is_none")] + pub index_type: Option, + /// Protobuf type URL, a precise type identifier for the index. + #[serde(rename = "type_url", skip_serializing_if = "Option::is_none")] + pub type_url: Option, + /// Approximate number of rows covered by the index. May include deleted rows. + #[serde(rename = "num_indexed_rows", skip_serializing_if = "Option::is_none")] + pub num_indexed_rows: Option, + /// Total index size in bytes across all segments. Null for indices predating file-size tracking. + #[serde(rename = "size_bytes", skip_serializing_if = "Option::is_none")] + pub size_bytes: Option, + /// Number of index deltas/segments. + #[serde(rename = "num_segments", skip_serializing_if = "Option::is_none")] + pub num_segments: Option, + /// Earliest creation time across the index segments. Null for legacy indices. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// On-disk index format version. + #[serde(rename = "index_version", skip_serializing_if = "Option::is_none")] + pub index_version: Option, + /// Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. + #[serde(rename = "index_details", skip_serializing_if = "Option::is_none")] + pub index_details: Option, } impl IndexContent { @@ -34,6 +58,14 @@ impl IndexContent { index_uuid, columns, status, + index_type: None, + type_url: None, + num_indexed_rows: None, + size_bytes: None, + num_segments: None, + created_at: None, + index_version: None, + index_details: None, } } } From 26dac2f06b3c1c059306f8ccc67946101e24e8c0 Mon Sep 17 00:00:00 2001 From: Will Jones Date: Thu, 4 Jun 2026 11:24:28 -0700 Subject: [PATCH 2/3] docs: clarify num_indexed_rows and created_at descriptions Address review feedback: num_indexed_rows counts live rows (deletes excluded), and created_at is simply the index creation time. --- docs/src/spec.yaml | 7 +++---- java/lance-namespace-apache-client/api/openapi.yaml | 7 +++---- .../lance-namespace-apache-client/docs/IndexContent.md | 4 ++-- .../java/org/lance/namespace/model/IndexContent.java | 5 +++-- java/lance-namespace-async-client/api/openapi.yaml | 7 +++---- java/lance-namespace-async-client/docs/IndexContent.md | 4 ++-- .../java/org/lance/namespace/model/IndexContent.java | 5 +++-- .../server/springboot/model/IndexContent.java | 10 ++++++---- .../docs/IndexContent.md | 4 ++-- .../models/index_content.py | 4 ++-- .../docs/IndexContent.md | 4 ++-- .../src/models/index_content.rs | 4 ++-- 12 files changed, 33 insertions(+), 32 deletions(-) diff --git a/docs/src/spec.yaml b/docs/src/spec.yaml index 76f99a000..48a2b6001 100644 --- a/docs/src/spec.yaml +++ b/docs/src/spec.yaml @@ -3232,8 +3232,8 @@ components: format: int64 minimum: 0 description: >- - Approximate number of rows covered by the index. May include - deleted rows. + Number of live rows covered by the index. This does not count + rows that are in the index but have since been deleted. size_bytes: type: integer format: int64 @@ -3252,8 +3252,7 @@ components: format: date-time nullable: true description: >- - Earliest creation time across the index segments. Null for legacy - indices. + Creation time for indexes. Null for legacy indices. index_version: type: integer format: int32 diff --git a/java/lance-namespace-apache-client/api/openapi.yaml b/java/lance-namespace-apache-client/api/openapi.yaml index 7521e09d0..2a25e3165 100644 --- a/java/lance-namespace-apache-client/api/openapi.yaml +++ b/java/lance-namespace-apache-client/api/openapi.yaml @@ -4563,8 +4563,8 @@ components: description: "Protobuf type URL, a precise type identifier for the index." type: string num_indexed_rows: - description: Approximate number of rows covered by the index. May include - deleted rows. + description: Number of live rows covered by the index. This does not count + rows that are in the index but have since been deleted. format: int64 minimum: 0 type: integer @@ -4581,8 +4581,7 @@ components: minimum: 0 type: integer created_at: - description: Earliest creation time across the index segments. Null for - legacy indices. + description: Creation time for indexes. Null for legacy indices. format: date-time type: string nullable: true diff --git a/java/lance-namespace-apache-client/docs/IndexContent.md b/java/lance-namespace-apache-client/docs/IndexContent.md index 3c9bdaf9a..65f6a763b 100644 --- a/java/lance-namespace-apache-client/docs/IndexContent.md +++ b/java/lance-namespace-apache-client/docs/IndexContent.md @@ -13,10 +13,10 @@ |**status** | **String** | Current status of the index | | |**indexType** | **String** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] | |**typeUrl** | **String** | Protobuf type URL, a precise type identifier for the index. | [optional] | -|**numIndexedRows** | **Long** | Approximate number of rows covered by the index. May include deleted rows. | [optional] | +|**numIndexedRows** | **Long** | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] | |**sizeBytes** | **Long** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] | |**numSegments** | **Integer** | Number of index deltas/segments. | [optional] | -|**createdAt** | **OffsetDateTime** | Earliest creation time across the index segments. Null for legacy indices. | [optional] | +|**createdAt** | **OffsetDateTime** | Creation time for indexes. Null for legacy indices. | [optional] | |**indexVersion** | **Integer** | On-disk index format version. | [optional] | |**indexDetails** | **String** | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] | diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java index e4a19ebad..35126f307 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java @@ -241,7 +241,8 @@ public IndexContent numIndexedRows(@javax.annotation.Nullable Long numIndexedRow } /** - * Approximate number of rows covered by the index. May include deleted rows. minimum: 0 + * Number of live rows covered by the index. This does not count rows that are in the index but + * have since been deleted. minimum: 0 * * @return numIndexedRows */ @@ -314,7 +315,7 @@ public IndexContent createdAt(@javax.annotation.Nullable OffsetDateTime createdA } /** - * Earliest creation time across the index segments. Null for legacy indices. + * Creation time for indexes. Null for legacy indices. * * @return createdAt */ diff --git a/java/lance-namespace-async-client/api/openapi.yaml b/java/lance-namespace-async-client/api/openapi.yaml index 7521e09d0..2a25e3165 100644 --- a/java/lance-namespace-async-client/api/openapi.yaml +++ b/java/lance-namespace-async-client/api/openapi.yaml @@ -4563,8 +4563,8 @@ components: description: "Protobuf type URL, a precise type identifier for the index." type: string num_indexed_rows: - description: Approximate number of rows covered by the index. May include - deleted rows. + description: Number of live rows covered by the index. This does not count + rows that are in the index but have since been deleted. format: int64 minimum: 0 type: integer @@ -4581,8 +4581,7 @@ components: minimum: 0 type: integer created_at: - description: Earliest creation time across the index segments. Null for - legacy indices. + description: Creation time for indexes. Null for legacy indices. format: date-time type: string nullable: true diff --git a/java/lance-namespace-async-client/docs/IndexContent.md b/java/lance-namespace-async-client/docs/IndexContent.md index 3c9bdaf9a..65f6a763b 100644 --- a/java/lance-namespace-async-client/docs/IndexContent.md +++ b/java/lance-namespace-async-client/docs/IndexContent.md @@ -13,10 +13,10 @@ |**status** | **String** | Current status of the index | | |**indexType** | **String** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] | |**typeUrl** | **String** | Protobuf type URL, a precise type identifier for the index. | [optional] | -|**numIndexedRows** | **Long** | Approximate number of rows covered by the index. May include deleted rows. | [optional] | +|**numIndexedRows** | **Long** | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] | |**sizeBytes** | **Long** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] | |**numSegments** | **Integer** | Number of index deltas/segments. | [optional] | -|**createdAt** | **OffsetDateTime** | Earliest creation time across the index segments. Null for legacy indices. | [optional] | +|**createdAt** | **OffsetDateTime** | Creation time for indexes. Null for legacy indices. | [optional] | |**indexVersion** | **Integer** | On-disk index format version. | [optional] | |**indexDetails** | **String** | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] | diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java index b2f849940..1b848d396 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java @@ -234,7 +234,8 @@ public IndexContent numIndexedRows(@javax.annotation.Nullable Long numIndexedRow } /** - * Approximate number of rows covered by the index. May include deleted rows. minimum: 0 + * Number of live rows covered by the index. This does not count rows that are in the index but + * have since been deleted. minimum: 0 * * @return numIndexedRows */ @@ -304,7 +305,7 @@ public IndexContent createdAt(@javax.annotation.Nullable OffsetDateTime createdA } /** - * Earliest creation time across the index segments. Null for legacy indices. + * Creation time for indexes. Null for legacy indices. * * @return createdAt */ diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java index 0f7a8f82a..157b94942 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java @@ -226,14 +226,16 @@ public IndexContent numIndexedRows(Long numIndexedRows) { } /** - * Approximate number of rows covered by the index. May include deleted rows. minimum: 0 + * Number of live rows covered by the index. This does not count rows that are in the index but + * have since been deleted. minimum: 0 * * @return numIndexedRows */ @Min(0L) @Schema( name = "num_indexed_rows", - description = "Approximate number of rows covered by the index. May include deleted rows.", + description = + "Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("num_indexed_rows") public Long getNumIndexedRows() { @@ -300,14 +302,14 @@ public IndexContent createdAt(OffsetDateTime createdAt) { } /** - * Earliest creation time across the index segments. Null for legacy indices. + * Creation time for indexes. Null for legacy indices. * * @return createdAt */ @Valid @Schema( name = "created_at", - description = "Earliest creation time across the index segments. Null for legacy indices.", + description = "Creation time for indexes. Null for legacy indices.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { diff --git a/python/lance_namespace_urllib3_client/docs/IndexContent.md b/python/lance_namespace_urllib3_client/docs/IndexContent.md index 3b29eb28a..cad26503b 100644 --- a/python/lance_namespace_urllib3_client/docs/IndexContent.md +++ b/python/lance_namespace_urllib3_client/docs/IndexContent.md @@ -11,10 +11,10 @@ Name | Type | Description | Notes **status** | **str** | Current status of the index | **index_type** | **str** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] **type_url** | **str** | Protobuf type URL, a precise type identifier for the index. | [optional] -**num_indexed_rows** | **int** | Approximate number of rows covered by the index. May include deleted rows. | [optional] +**num_indexed_rows** | **int** | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] **size_bytes** | **int** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] **num_segments** | **int** | Number of index deltas/segments. | [optional] -**created_at** | **datetime** | Earliest creation time across the index segments. Null for legacy indices. | [optional] +**created_at** | **datetime** | Creation time for indexes. Null for legacy indices. | [optional] **index_version** | **int** | On-disk index format version. | [optional] **index_details** | **str** | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py index 29c07b087..383e372e8 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py @@ -34,10 +34,10 @@ class IndexContent(BaseModel): status: StrictStr = Field(description="Current status of the index") index_type: Optional[StrictStr] = Field(default=None, description="Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index.") type_url: Optional[StrictStr] = Field(default=None, description="Protobuf type URL, a precise type identifier for the index.") - num_indexed_rows: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Approximate number of rows covered by the index. May include deleted rows.") + num_indexed_rows: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted.") size_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Total index size in bytes across all segments. Null for indices predating file-size tracking.") num_segments: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Number of index deltas/segments.") - created_at: Optional[datetime] = Field(default=None, description="Earliest creation time across the index segments. Null for legacy indices.") + created_at: Optional[datetime] = Field(default=None, description="Creation time for indexes. Null for legacy indices.") index_version: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="On-disk index format version.") index_details: Optional[StrictStr] = Field(default=None, description="Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters.") __properties: ClassVar[List[str]] = ["index_name", "index_uuid", "columns", "status", "index_type", "type_url", "num_indexed_rows", "size_bytes", "num_segments", "created_at", "index_version", "index_details"] diff --git a/rust/lance-namespace-reqwest-client/docs/IndexContent.md b/rust/lance-namespace-reqwest-client/docs/IndexContent.md index 769bf0dc2..e321b642a 100644 --- a/rust/lance-namespace-reqwest-client/docs/IndexContent.md +++ b/rust/lance-namespace-reqwest-client/docs/IndexContent.md @@ -10,10 +10,10 @@ Name | Type | Description | Notes **status** | **String** | Current status of the index | **index_type** | Option<**String**> | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] **type_url** | Option<**String**> | Protobuf type URL, a precise type identifier for the index. | [optional] -**num_indexed_rows** | Option<**i64**> | Approximate number of rows covered by the index. May include deleted rows. | [optional] +**num_indexed_rows** | Option<**i64**> | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] **size_bytes** | Option<**i64**> | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] **num_segments** | Option<**i32**> | Number of index deltas/segments. | [optional] -**created_at** | Option<**String**> | Earliest creation time across the index segments. Null for legacy indices. | [optional] +**created_at** | Option<**String**> | Creation time for indexes. Null for legacy indices. | [optional] **index_version** | Option<**i32**> | On-disk index format version. | [optional] **index_details** | Option<**String**> | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] diff --git a/rust/lance-namespace-reqwest-client/src/models/index_content.rs b/rust/lance-namespace-reqwest-client/src/models/index_content.rs index 14130243b..9f0d5cf7d 100644 --- a/rust/lance-namespace-reqwest-client/src/models/index_content.rs +++ b/rust/lance-namespace-reqwest-client/src/models/index_content.rs @@ -31,7 +31,7 @@ pub struct IndexContent { /// Protobuf type URL, a precise type identifier for the index. #[serde(rename = "type_url", skip_serializing_if = "Option::is_none")] pub type_url: Option, - /// Approximate number of rows covered by the index. May include deleted rows. + /// Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. #[serde(rename = "num_indexed_rows", skip_serializing_if = "Option::is_none")] pub num_indexed_rows: Option, /// Total index size in bytes across all segments. Null for indices predating file-size tracking. @@ -40,7 +40,7 @@ pub struct IndexContent { /// Number of index deltas/segments. #[serde(rename = "num_segments", skip_serializing_if = "Option::is_none")] pub num_segments: Option, - /// Earliest creation time across the index segments. Null for legacy indices. + /// Creation time for indexes. Null for legacy indices. #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] pub created_at: Option, /// On-disk index format version. From c53bb5fad3a3bc557978e34decf26171a69c5d6b Mon Sep 17 00:00:00 2001 From: Will Jones Date: Tue, 9 Jun 2026 14:53:05 -0700 Subject: [PATCH 3/3] add num_unindexed_rows --- .../models/AddVirtualColumnEntry.md | 2 +- .../models/AddVirtualColumnOutputEntry.md | 17 +++++++ .../operations/models/IndexContent.md | 9 ++++ docs/src/spec.yaml | 6 +++ .../api/openapi.yaml | 26 ++++++---- .../docs/IndexContent.md | 1 + .../lance/namespace/model/IndexContent.java | 47 +++++++++++++++++++ .../api/openapi.yaml | 26 ++++++---- .../docs/IndexContent.md | 1 + .../lance/namespace/model/IndexContent.java | 38 +++++++++++++++ .../server/springboot/api/TableApi.java | 2 +- .../server/springboot/model/IndexContent.java | 29 ++++++++++++ .../docs/IndexContent.md | 1 + .../models/index_content.py | 4 +- .../test/test_index_content.py | 1 + .../test/test_list_table_indices_response.py | 2 + .../docs/IndexContent.md | 1 + .../src/models/index_content.rs | 4 ++ 18 files changed, 196 insertions(+), 21 deletions(-) create mode 100644 docs/src/namespace/operations/models/AddVirtualColumnOutputEntry.md diff --git a/docs/src/namespace/operations/models/AddVirtualColumnEntry.md b/docs/src/namespace/operations/models/AddVirtualColumnEntry.md index 8bec05a72..bbcb298d1 100644 --- a/docs/src/namespace/operations/models/AddVirtualColumnEntry.md +++ b/docs/src/namespace/operations/models/AddVirtualColumnEntry.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**inputColumns** | **List<String>** | List of input column names for the virtual column | | -|**dataType** | **Object** | Data type of the virtual column using JSON representation | | +|**outputs** | [**List<AddVirtualColumnOutputEntry>**](AddVirtualColumnOutputEntry.md) | Output columns produced by the virtual column UDF | | |**image** | **String** | Docker image to use for the UDF | | |**udf** | **String** | Base64 encoded pickled UDF | | |**udfName** | **String** | Name of the UDF | | diff --git a/docs/src/namespace/operations/models/AddVirtualColumnOutputEntry.md b/docs/src/namespace/operations/models/AddVirtualColumnOutputEntry.md new file mode 100644 index 000000000..9fad32792 --- /dev/null +++ b/docs/src/namespace/operations/models/AddVirtualColumnOutputEntry.md @@ -0,0 +1,17 @@ + + +# AddVirtualColumnOutputEntry + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**column** | **String** | Physical output column name | | +|**structField** | **String** | Field name in the UDF output struct | | +|**dataType** | **Object** | Data type of the output column using JSON representation | | +|**nullable** | **Boolean** | Whether the output column is nullable | | +|**metadata** | **Map<String, String>** | User-supplied output field metadata (string key-value pairs) | [optional] | + + + diff --git a/docs/src/namespace/operations/models/IndexContent.md b/docs/src/namespace/operations/models/IndexContent.md index 131589588..eba60f16e 100644 --- a/docs/src/namespace/operations/models/IndexContent.md +++ b/docs/src/namespace/operations/models/IndexContent.md @@ -11,6 +11,15 @@ |**indexUuid** | **String** | Unique identifier for the index | | |**columns** | **List<String>** | Columns covered by this index | | |**status** | **String** | Current status of the index | | +|**indexType** | **String** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] | +|**typeUrl** | **String** | Protobuf type URL, a precise type identifier for the index. | [optional] | +|**numIndexedRows** | **Long** | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] | +|**numUnindexedRows** | **Long** | Number of rows that are not indexed. | [optional] | +|**sizeBytes** | **Long** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] | +|**numSegments** | **Integer** | Number of index deltas/segments. | [optional] | +|**createdAt** | **OffsetDateTime** | Creation time for indexes. Null for legacy indices. | [optional] | +|**indexVersion** | **Integer** | On-disk index format version. | [optional] | +|**indexDetails** | **String** | Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. | [optional] | diff --git a/docs/src/spec.yaml b/docs/src/spec.yaml index 48a2b6001..e64c27b81 100644 --- a/docs/src/spec.yaml +++ b/docs/src/spec.yaml @@ -3234,6 +3234,12 @@ components: description: >- Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. + num_unindexed_rows: + type: integer + format: int64 + minimum: 0 + description: >- + Number of rows that are not indexed. size_bytes: type: integer format: int64 diff --git a/java/lance-namespace-apache-client/api/openapi.yaml b/java/lance-namespace-apache-client/api/openapi.yaml index 2a25e3165..336737065 100644 --- a/java/lance-namespace-apache-client/api/openapi.yaml +++ b/java/lance-namespace-apache-client/api/openapi.yaml @@ -4469,7 +4469,6 @@ components: example: indexes: - index_uuid: index_uuid - index_version: 0 size_bytes: 0 columns: - columns @@ -4477,13 +4476,14 @@ components: created_at: 2000-01-23T04:56:07.000+00:00 index_details: index_details num_indexed_rows: 0 - index_name: index_name num_segments: 0 - status: status index_type: index_type + index_version: 0 + num_unindexed_rows: 0 + index_name: index_name + status: status type_url: type_url - index_uuid: index_uuid - index_version: 0 size_bytes: 0 columns: - columns @@ -4491,10 +4491,12 @@ components: created_at: 2000-01-23T04:56:07.000+00:00 index_details: index_details num_indexed_rows: 0 - index_name: index_name num_segments: 0 - status: status index_type: index_type + index_version: 0 + num_unindexed_rows: 0 + index_name: index_name + status: status type_url: type_url page_token: page_token properties: @@ -4527,7 +4529,6 @@ components: IndexContent: example: index_uuid: index_uuid - index_version: 0 size_bytes: 0 columns: - columns @@ -4535,10 +4536,12 @@ components: created_at: 2000-01-23T04:56:07.000+00:00 index_details: index_details num_indexed_rows: 0 - index_name: index_name num_segments: 0 - status: status index_type: index_type + index_version: 0 + num_unindexed_rows: 0 + index_name: index_name + status: status type_url: type_url properties: index_name: @@ -4568,6 +4571,11 @@ components: format: int64 minimum: 0 type: integer + num_unindexed_rows: + description: Number of rows that are not indexed. + format: int64 + minimum: 0 + type: integer size_bytes: description: Total index size in bytes across all segments. Null for indices predating file-size tracking. diff --git a/java/lance-namespace-apache-client/docs/IndexContent.md b/java/lance-namespace-apache-client/docs/IndexContent.md index 65f6a763b..eba60f16e 100644 --- a/java/lance-namespace-apache-client/docs/IndexContent.md +++ b/java/lance-namespace-apache-client/docs/IndexContent.md @@ -14,6 +14,7 @@ |**indexType** | **String** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] | |**typeUrl** | **String** | Protobuf type URL, a precise type identifier for the index. | [optional] | |**numIndexedRows** | **Long** | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] | +|**numUnindexedRows** | **Long** | Number of rows that are not indexed. | [optional] | |**sizeBytes** | **Long** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] | |**numSegments** | **Integer** | Number of index deltas/segments. | [optional] | |**createdAt** | **OffsetDateTime** | Creation time for indexes. Null for legacy indices. | [optional] | diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java index 35126f307..287221b9e 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/IndexContent.java @@ -34,6 +34,7 @@ IndexContent.JSON_PROPERTY_INDEX_TYPE, IndexContent.JSON_PROPERTY_TYPE_URL, IndexContent.JSON_PROPERTY_NUM_INDEXED_ROWS, + IndexContent.JSON_PROPERTY_NUM_UNINDEXED_ROWS, IndexContent.JSON_PROPERTY_SIZE_BYTES, IndexContent.JSON_PROPERTY_NUM_SEGMENTS, IndexContent.JSON_PROPERTY_CREATED_AT, @@ -65,6 +66,9 @@ public class IndexContent { public static final String JSON_PROPERTY_NUM_INDEXED_ROWS = "num_indexed_rows"; @javax.annotation.Nullable private Long numIndexedRows; + public static final String JSON_PROPERTY_NUM_UNINDEXED_ROWS = "num_unindexed_rows"; + @javax.annotation.Nullable private Long numUnindexedRows; + public static final String JSON_PROPERTY_SIZE_BYTES = "size_bytes"; @javax.annotation.Nullable private Long sizeBytes; @@ -259,6 +263,30 @@ public void setNumIndexedRows(@javax.annotation.Nullable Long numIndexedRows) { this.numIndexedRows = numIndexedRows; } + public IndexContent numUnindexedRows(@javax.annotation.Nullable Long numUnindexedRows) { + + this.numUnindexedRows = numUnindexedRows; + return this; + } + + /** + * Number of rows that are not indexed. minimum: 0 + * + * @return numUnindexedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_UNINDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumUnindexedRows() { + return numUnindexedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_UNINDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumUnindexedRows(@javax.annotation.Nullable Long numUnindexedRows) { + this.numUnindexedRows = numUnindexedRows; + } + public IndexContent sizeBytes(@javax.annotation.Nullable Long sizeBytes) { this.sizeBytes = sizeBytes; @@ -397,6 +425,7 @@ public boolean equals(Object o) { && Objects.equals(this.indexType, indexContent.indexType) && Objects.equals(this.typeUrl, indexContent.typeUrl) && Objects.equals(this.numIndexedRows, indexContent.numIndexedRows) + && Objects.equals(this.numUnindexedRows, indexContent.numUnindexedRows) && Objects.equals(this.sizeBytes, indexContent.sizeBytes) && Objects.equals(this.numSegments, indexContent.numSegments) && Objects.equals(this.createdAt, indexContent.createdAt) @@ -414,6 +443,7 @@ public int hashCode() { indexType, typeUrl, numIndexedRows, + numUnindexedRows, sizeBytes, numSegments, createdAt, @@ -432,6 +462,7 @@ public String toString() { sb.append(" indexType: ").append(toIndentedString(indexType)).append("\n"); sb.append(" typeUrl: ").append(toIndentedString(typeUrl)).append("\n"); sb.append(" numIndexedRows: ").append(toIndentedString(numIndexedRows)).append("\n"); + sb.append(" numUnindexedRows: ").append(toIndentedString(numUnindexedRows)).append("\n"); sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); sb.append(" numSegments: ").append(toIndentedString(numSegments)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); @@ -598,6 +629,22 @@ public String toUrlQueryString(String prefix) { } } + // add `num_unindexed_rows` to the URL query string + if (getNumUnindexedRows() != null) { + try { + joiner.add( + String.format( + "%snum_unindexed_rows%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getNumUnindexedRows()), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + // add `size_bytes` to the URL query string if (getSizeBytes() != null) { try { diff --git a/java/lance-namespace-async-client/api/openapi.yaml b/java/lance-namespace-async-client/api/openapi.yaml index 2a25e3165..336737065 100644 --- a/java/lance-namespace-async-client/api/openapi.yaml +++ b/java/lance-namespace-async-client/api/openapi.yaml @@ -4469,7 +4469,6 @@ components: example: indexes: - index_uuid: index_uuid - index_version: 0 size_bytes: 0 columns: - columns @@ -4477,13 +4476,14 @@ components: created_at: 2000-01-23T04:56:07.000+00:00 index_details: index_details num_indexed_rows: 0 - index_name: index_name num_segments: 0 - status: status index_type: index_type + index_version: 0 + num_unindexed_rows: 0 + index_name: index_name + status: status type_url: type_url - index_uuid: index_uuid - index_version: 0 size_bytes: 0 columns: - columns @@ -4491,10 +4491,12 @@ components: created_at: 2000-01-23T04:56:07.000+00:00 index_details: index_details num_indexed_rows: 0 - index_name: index_name num_segments: 0 - status: status index_type: index_type + index_version: 0 + num_unindexed_rows: 0 + index_name: index_name + status: status type_url: type_url page_token: page_token properties: @@ -4527,7 +4529,6 @@ components: IndexContent: example: index_uuid: index_uuid - index_version: 0 size_bytes: 0 columns: - columns @@ -4535,10 +4536,12 @@ components: created_at: 2000-01-23T04:56:07.000+00:00 index_details: index_details num_indexed_rows: 0 - index_name: index_name num_segments: 0 - status: status index_type: index_type + index_version: 0 + num_unindexed_rows: 0 + index_name: index_name + status: status type_url: type_url properties: index_name: @@ -4568,6 +4571,11 @@ components: format: int64 minimum: 0 type: integer + num_unindexed_rows: + description: Number of rows that are not indexed. + format: int64 + minimum: 0 + type: integer size_bytes: description: Total index size in bytes across all segments. Null for indices predating file-size tracking. diff --git a/java/lance-namespace-async-client/docs/IndexContent.md b/java/lance-namespace-async-client/docs/IndexContent.md index 65f6a763b..eba60f16e 100644 --- a/java/lance-namespace-async-client/docs/IndexContent.md +++ b/java/lance-namespace-async-client/docs/IndexContent.md @@ -14,6 +14,7 @@ |**indexType** | **String** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] | |**typeUrl** | **String** | Protobuf type URL, a precise type identifier for the index. | [optional] | |**numIndexedRows** | **Long** | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] | +|**numUnindexedRows** | **Long** | Number of rows that are not indexed. | [optional] | |**sizeBytes** | **Long** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] | |**numSegments** | **Integer** | Number of index deltas/segments. | [optional] | |**createdAt** | **OffsetDateTime** | Creation time for indexes. Null for legacy indices. | [optional] | diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java index 1b848d396..2c05512cb 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java @@ -34,6 +34,7 @@ IndexContent.JSON_PROPERTY_INDEX_TYPE, IndexContent.JSON_PROPERTY_TYPE_URL, IndexContent.JSON_PROPERTY_NUM_INDEXED_ROWS, + IndexContent.JSON_PROPERTY_NUM_UNINDEXED_ROWS, IndexContent.JSON_PROPERTY_SIZE_BYTES, IndexContent.JSON_PROPERTY_NUM_SEGMENTS, IndexContent.JSON_PROPERTY_CREATED_AT, @@ -65,6 +66,9 @@ public class IndexContent { public static final String JSON_PROPERTY_NUM_INDEXED_ROWS = "num_indexed_rows"; @javax.annotation.Nullable private Long numIndexedRows; + public static final String JSON_PROPERTY_NUM_UNINDEXED_ROWS = "num_unindexed_rows"; + @javax.annotation.Nullable private Long numUnindexedRows; + public static final String JSON_PROPERTY_SIZE_BYTES = "size_bytes"; @javax.annotation.Nullable private Long sizeBytes; @@ -252,6 +256,29 @@ public void setNumIndexedRows(@javax.annotation.Nullable Long numIndexedRows) { this.numIndexedRows = numIndexedRows; } + public IndexContent numUnindexedRows(@javax.annotation.Nullable Long numUnindexedRows) { + this.numUnindexedRows = numUnindexedRows; + return this; + } + + /** + * Number of rows that are not indexed. minimum: 0 + * + * @return numUnindexedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_UNINDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumUnindexedRows() { + return numUnindexedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_UNINDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumUnindexedRows(@javax.annotation.Nullable Long numUnindexedRows) { + this.numUnindexedRows = numUnindexedRows; + } + public IndexContent sizeBytes(@javax.annotation.Nullable Long sizeBytes) { this.sizeBytes = sizeBytes; return this; @@ -386,6 +413,7 @@ public boolean equals(Object o) { && Objects.equals(this.indexType, indexContent.indexType) && Objects.equals(this.typeUrl, indexContent.typeUrl) && Objects.equals(this.numIndexedRows, indexContent.numIndexedRows) + && Objects.equals(this.numUnindexedRows, indexContent.numUnindexedRows) && Objects.equals(this.sizeBytes, indexContent.sizeBytes) && Objects.equals(this.numSegments, indexContent.numSegments) && Objects.equals(this.createdAt, indexContent.createdAt) @@ -403,6 +431,7 @@ public int hashCode() { indexType, typeUrl, numIndexedRows, + numUnindexedRows, sizeBytes, numSegments, createdAt, @@ -421,6 +450,7 @@ public String toString() { sb.append(" indexType: ").append(toIndentedString(indexType)).append("\n"); sb.append(" typeUrl: ").append(toIndentedString(typeUrl)).append("\n"); sb.append(" numIndexedRows: ").append(toIndentedString(numIndexedRows)).append("\n"); + sb.append(" numUnindexedRows: ").append(toIndentedString(numUnindexedRows)).append("\n"); sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); sb.append(" numSegments: ").append(toIndentedString(numSegments)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); @@ -535,6 +565,14 @@ public String toUrlQueryString(String prefix) { prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumIndexedRows())))); } + // add `num_unindexed_rows` to the URL query string + if (getNumUnindexedRows() != null) { + joiner.add( + String.format( + "%snum_unindexed_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumUnindexedRows())))); + } + // add `size_bytes` to the URL query string if (getSizeBytes() != null) { joiner.add( diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java index 90fa0ffe7..16cc7f9e7 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java @@ -5318,7 +5318,7 @@ default ResponseEntity listTableIndices( for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = - "{ \"indexes\" : [ { \"index_uuid\" : \"index_uuid\", \"index_version\" : 0, \"size_bytes\" : 0, \"columns\" : [ \"columns\", \"columns\" ], \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"index_details\" : \"index_details\", \"num_indexed_rows\" : 0, \"index_name\" : \"index_name\", \"num_segments\" : 0, \"status\" : \"status\", \"index_type\" : \"index_type\", \"type_url\" : \"type_url\" }, { \"index_uuid\" : \"index_uuid\", \"index_version\" : 0, \"size_bytes\" : 0, \"columns\" : [ \"columns\", \"columns\" ], \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"index_details\" : \"index_details\", \"num_indexed_rows\" : 0, \"index_name\" : \"index_name\", \"num_segments\" : 0, \"status\" : \"status\", \"index_type\" : \"index_type\", \"type_url\" : \"type_url\" } ], \"page_token\" : \"page_token\" }"; + "{ \"indexes\" : [ { \"index_uuid\" : \"index_uuid\", \"size_bytes\" : 0, \"columns\" : [ \"columns\", \"columns\" ], \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"index_details\" : \"index_details\", \"num_indexed_rows\" : 0, \"num_segments\" : 0, \"index_type\" : \"index_type\", \"index_version\" : 0, \"num_unindexed_rows\" : 0, \"index_name\" : \"index_name\", \"status\" : \"status\", \"type_url\" : \"type_url\" }, { \"index_uuid\" : \"index_uuid\", \"size_bytes\" : 0, \"columns\" : [ \"columns\", \"columns\" ], \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"index_details\" : \"index_details\", \"num_indexed_rows\" : 0, \"num_segments\" : 0, \"index_type\" : \"index_type\", \"index_version\" : 0, \"num_unindexed_rows\" : 0, \"index_name\" : \"index_name\", \"status\" : \"status\", \"type_url\" : \"type_url\" } ], \"page_token\" : \"page_token\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java index 157b94942..5f5cfe09e 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/IndexContent.java @@ -46,6 +46,8 @@ public class IndexContent { private Long numIndexedRows; + private Long numUnindexedRows; + private Long sizeBytes; private Integer numSegments; @@ -246,6 +248,30 @@ public void setNumIndexedRows(Long numIndexedRows) { this.numIndexedRows = numIndexedRows; } + public IndexContent numUnindexedRows(Long numUnindexedRows) { + this.numUnindexedRows = numUnindexedRows; + return this; + } + + /** + * Number of rows that are not indexed. minimum: 0 + * + * @return numUnindexedRows + */ + @Min(0L) + @Schema( + name = "num_unindexed_rows", + description = "Number of rows that are not indexed.", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("num_unindexed_rows") + public Long getNumUnindexedRows() { + return numUnindexedRows; + } + + public void setNumUnindexedRows(Long numUnindexedRows) { + this.numUnindexedRows = numUnindexedRows; + } + public IndexContent sizeBytes(Long sizeBytes) { this.sizeBytes = sizeBytes; return this; @@ -385,6 +411,7 @@ public boolean equals(Object o) { && Objects.equals(this.indexType, indexContent.indexType) && Objects.equals(this.typeUrl, indexContent.typeUrl) && Objects.equals(this.numIndexedRows, indexContent.numIndexedRows) + && Objects.equals(this.numUnindexedRows, indexContent.numUnindexedRows) && Objects.equals(this.sizeBytes, indexContent.sizeBytes) && Objects.equals(this.numSegments, indexContent.numSegments) && Objects.equals(this.createdAt, indexContent.createdAt) @@ -402,6 +429,7 @@ public int hashCode() { indexType, typeUrl, numIndexedRows, + numUnindexedRows, sizeBytes, numSegments, createdAt, @@ -420,6 +448,7 @@ public String toString() { sb.append(" indexType: ").append(toIndentedString(indexType)).append("\n"); sb.append(" typeUrl: ").append(toIndentedString(typeUrl)).append("\n"); sb.append(" numIndexedRows: ").append(toIndentedString(numIndexedRows)).append("\n"); + sb.append(" numUnindexedRows: ").append(toIndentedString(numUnindexedRows)).append("\n"); sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); sb.append(" numSegments: ").append(toIndentedString(numSegments)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); diff --git a/python/lance_namespace_urllib3_client/docs/IndexContent.md b/python/lance_namespace_urllib3_client/docs/IndexContent.md index cad26503b..f8d470e24 100644 --- a/python/lance_namespace_urllib3_client/docs/IndexContent.md +++ b/python/lance_namespace_urllib3_client/docs/IndexContent.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **index_type** | **str** | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] **type_url** | **str** | Protobuf type URL, a precise type identifier for the index. | [optional] **num_indexed_rows** | **int** | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] +**num_unindexed_rows** | **int** | Number of rows that are not indexed. | [optional] **size_bytes** | **int** | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] **num_segments** | **int** | Number of index deltas/segments. | [optional] **created_at** | **datetime** | Creation time for indexes. Null for legacy indices. | [optional] diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py index 383e372e8..47898e38a 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/index_content.py @@ -35,12 +35,13 @@ class IndexContent(BaseModel): index_type: Optional[StrictStr] = Field(default=None, description="Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index.") type_url: Optional[StrictStr] = Field(default=None, description="Protobuf type URL, a precise type identifier for the index.") num_indexed_rows: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted.") + num_unindexed_rows: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Number of rows that are not indexed.") size_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Total index size in bytes across all segments. Null for indices predating file-size tracking.") num_segments: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Number of index deltas/segments.") created_at: Optional[datetime] = Field(default=None, description="Creation time for indexes. Null for legacy indices.") index_version: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="On-disk index format version.") index_details: Optional[StrictStr] = Field(default=None, description="Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters.") - __properties: ClassVar[List[str]] = ["index_name", "index_uuid", "columns", "status", "index_type", "type_url", "num_indexed_rows", "size_bytes", "num_segments", "created_at", "index_version", "index_details"] + __properties: ClassVar[List[str]] = ["index_name", "index_uuid", "columns", "status", "index_type", "type_url", "num_indexed_rows", "num_unindexed_rows", "size_bytes", "num_segments", "created_at", "index_version", "index_details"] model_config = ConfigDict( populate_by_name=True, @@ -100,6 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "index_type": obj.get("index_type"), "type_url": obj.get("type_url"), "num_indexed_rows": obj.get("num_indexed_rows"), + "num_unindexed_rows": obj.get("num_unindexed_rows"), "size_bytes": obj.get("size_bytes"), "num_segments": obj.get("num_segments"), "created_at": obj.get("created_at"), diff --git a/python/lance_namespace_urllib3_client/test/test_index_content.py b/python/lance_namespace_urllib3_client/test/test_index_content.py index b912c4a84..9d67bc695 100644 --- a/python/lance_namespace_urllib3_client/test/test_index_content.py +++ b/python/lance_namespace_urllib3_client/test/test_index_content.py @@ -44,6 +44,7 @@ def make_instance(self, include_optional) -> IndexContent: index_type = '', type_url = '', num_indexed_rows = 0, + num_unindexed_rows = 0, size_bytes = 0, num_segments = 0, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), diff --git a/python/lance_namespace_urllib3_client/test/test_list_table_indices_response.py b/python/lance_namespace_urllib3_client/test/test_list_table_indices_response.py index 877dc75e1..8eb0c702e 100644 --- a/python/lance_namespace_urllib3_client/test/test_list_table_indices_response.py +++ b/python/lance_namespace_urllib3_client/test/test_list_table_indices_response.py @@ -46,6 +46,7 @@ def make_instance(self, include_optional) -> ListTableIndicesResponse: index_type = '', type_url = '', num_indexed_rows = 0, + num_unindexed_rows = 0, size_bytes = 0, num_segments = 0, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), @@ -67,6 +68,7 @@ def make_instance(self, include_optional) -> ListTableIndicesResponse: index_type = '', type_url = '', num_indexed_rows = 0, + num_unindexed_rows = 0, size_bytes = 0, num_segments = 0, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), diff --git a/rust/lance-namespace-reqwest-client/docs/IndexContent.md b/rust/lance-namespace-reqwest-client/docs/IndexContent.md index e321b642a..57d81b073 100644 --- a/rust/lance-namespace-reqwest-client/docs/IndexContent.md +++ b/rust/lance-namespace-reqwest-client/docs/IndexContent.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **index_type** | Option<**String**> | Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. | [optional] **type_url** | Option<**String**> | Protobuf type URL, a precise type identifier for the index. | [optional] **num_indexed_rows** | Option<**i64**> | Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. | [optional] +**num_unindexed_rows** | Option<**i64**> | Number of rows that are not indexed. | [optional] **size_bytes** | Option<**i64**> | Total index size in bytes across all segments. Null for indices predating file-size tracking. | [optional] **num_segments** | Option<**i32**> | Number of index deltas/segments. | [optional] **created_at** | Option<**String**> | Creation time for indexes. Null for legacy indices. | [optional] diff --git a/rust/lance-namespace-reqwest-client/src/models/index_content.rs b/rust/lance-namespace-reqwest-client/src/models/index_content.rs index 9f0d5cf7d..a8826706a 100644 --- a/rust/lance-namespace-reqwest-client/src/models/index_content.rs +++ b/rust/lance-namespace-reqwest-client/src/models/index_content.rs @@ -34,6 +34,9 @@ pub struct IndexContent { /// Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. #[serde(rename = "num_indexed_rows", skip_serializing_if = "Option::is_none")] pub num_indexed_rows: Option, + /// Number of rows that are not indexed. + #[serde(rename = "num_unindexed_rows", skip_serializing_if = "Option::is_none")] + pub num_unindexed_rows: Option, /// Total index size in bytes across all segments. Null for indices predating file-size tracking. #[serde(rename = "size_bytes", skip_serializing_if = "Option::is_none")] pub size_bytes: Option, @@ -61,6 +64,7 @@ impl IndexContent { index_type: None, type_url: None, num_indexed_rows: None, + num_unindexed_rows: None, size_bytes: None, num_segments: None, created_at: None,