diff --git a/docs/src/namespace/operations/models/AddVirtualColumnEntry.md b/docs/src/namespace/operations/models/AddVirtualColumnEntry.md index 8bec05a7..bbcb298d 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 00000000..9fad3279 --- /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 13158958..eba60f16 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 e0c27c1a..e64c27b8 100644 --- a/docs/src/spec.yaml +++ b/docs/src/spec.yaml @@ -3219,6 +3219,58 @@ 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: >- + 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 + 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: >- + Creation time for indexes. 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 54006172..33673706 100644 --- a/java/lance-namespace-apache-client/api/openapi.yaml +++ b/java/lance-namespace-apache-client/api/openapi.yaml @@ -4469,17 +4469,35 @@ components: example: 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 properties: indexes: @@ -4511,11 +4529,20 @@ components: IndexContent: example: 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 properties: index_name: description: Name of the index @@ -4531,6 +4558,52 @@ 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: 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 + 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. + 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: Creation time for indexes. 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 13158958..eba60f16 100644 --- a/java/lance-namespace-apache-client/docs/IndexContent.md +++ b/java/lance-namespace-apache-client/docs/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/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 cf8e0a3f..287221b9 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,16 @@ 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_NUM_UNINDEXED_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 +57,33 @@ 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_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; + + 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 +190,225 @@ 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; + } + + /** + * 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 + */ + @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 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; + } + + /** + * 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; + } + + /** + * Creation time for indexes. 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 +421,34 @@ 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.numUnindexedRows, indexContent.numUnindexedRows) + && 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, + numUnindexedRows, + sizeBytes, + numSegments, + createdAt, + indexVersion, + indexDetails); } @Override @@ -181,6 +459,15 @@ 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(" 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"); + sb.append(" indexVersion: ").append(toIndentedString(indexVersion)).append("\n"); + sb.append(" indexDetails: ").append(toIndentedString(indexDetails)).append("\n"); sb.append("}"); return sb.toString(); } @@ -295,6 +582,149 @@ 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 `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 { + 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 54006172..33673706 100644 --- a/java/lance-namespace-async-client/api/openapi.yaml +++ b/java/lance-namespace-async-client/api/openapi.yaml @@ -4469,17 +4469,35 @@ components: example: 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 properties: indexes: @@ -4511,11 +4529,20 @@ components: IndexContent: example: 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 properties: index_name: description: Name of the index @@ -4531,6 +4558,52 @@ 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: 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 + 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. + 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: Creation time for indexes. 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 13158958..eba60f16 100644 --- a/java/lance-namespace-async-client/docs/IndexContent.md +++ b/java/lance-namespace-async-client/docs/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/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 c7d10027..2c05512c 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,16 @@ 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_NUM_UNINDEXED_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 +57,33 @@ 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_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; + + 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 +186,216 @@ 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; + } + + /** + * 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 + */ + @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 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; + } + + /** + * 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; + } + + /** + * Creation time for indexes. 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 +409,34 @@ 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.numUnindexedRows, indexContent.numUnindexedRows) + && 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, + numUnindexedRows, + sizeBytes, + numSegments, + createdAt, + indexVersion, + indexDetails); } @Override @@ -178,6 +447,15 @@ 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(" 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"); + sb.append(" indexVersion: ").append(toIndentedString(indexVersion)).append("\n"); + sb.append(" indexDetails: ").append(toIndentedString(indexDetails)).append("\n"); sb.append("}"); return sb.toString(); } @@ -263,6 +541,78 @@ 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 `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( + 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 8c608ba9..16cc7f9e 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\", \"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 89728296..5f5cfe09 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,25 @@ public class IndexContent { private String status; + private String indexType; + + private String typeUrl; + + private Long numIndexedRows; + + private Long numUnindexedRows; + + 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 +175,226 @@ 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; + } + + /** + * 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 = + "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() { + return numIndexedRows; + } + + 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; + } + + /** + * 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; + } + + /** + * Creation time for indexes. Null for legacy indices. + * + * @return createdAt + */ + @Valid + @Schema( + name = "created_at", + description = "Creation time for indexes. 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 +407,34 @@ 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.numUnindexedRows, indexContent.numUnindexedRows) + && 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, + numUnindexedRows, + sizeBytes, + numSegments, + createdAt, + indexVersion, + indexDetails); } @Override @@ -182,6 +445,15 @@ 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(" 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"); + 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 94aad07a..f8d470e2 100644 --- a/python/lance_namespace_urllib3_client/docs/IndexContent.md +++ b/python/lance_namespace_urllib3_client/docs/IndexContent.md @@ -9,6 +9,15 @@ 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** | 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] +**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 d7190f5f..47898e38 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,16 @@ 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="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", "num_unindexed_rows", "size_bytes", "num_segments", "created_at", "index_version", "index_details"] model_config = ConfigDict( populate_by_name=True, @@ -86,7 +97,16 @@ 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"), + "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"), + "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 efad2f1e..9d67bc69 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,16 @@ def make_instance(self, include_optional) -> IndexContent: columns = [ '' ], - status = '' + status = '', + 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'), + 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 9d346eeb..8eb0c702 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,16 @@ def make_instance(self, include_optional) -> ListTableIndicesResponse: columns = [ '' ], - status = '', ) + status = '', + 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'), + index_version = 0, + index_details = '', ) ], page_token = '' ) @@ -55,7 +64,16 @@ def make_instance(self, include_optional) -> ListTableIndicesResponse: columns = [ '' ], - status = '', ) + status = '', + 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'), + 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 6fd9e2a4..57d81b07 100644 --- a/rust/lance-namespace-reqwest-client/docs/IndexContent.md +++ b/rust/lance-namespace-reqwest-client/docs/IndexContent.md @@ -8,6 +8,15 @@ 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**> | 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] +**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 36b0a31e..a8826706 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,33 @@ 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, + /// 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, + /// Number of index deltas/segments. + #[serde(rename = "num_segments", skip_serializing_if = "Option::is_none")] + pub num_segments: Option, + /// 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. + #[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 +61,15 @@ impl IndexContent { index_uuid, columns, status, + index_type: None, + type_url: None, + num_indexed_rows: None, + num_unindexed_rows: None, + size_bytes: None, + num_segments: None, + created_at: None, + index_version: None, + index_details: None, } } }