Skip to content

Commit 16760a9

Browse files
authored
feat: fix java sdk query, table stats recursive structs, improve docs (#136)
Update query and table stats request/response structs to better match the server specification. Improve the java sdk doc with list indices, get index stats and varies queries
1 parent 89d5236 commit 16760a9

152 files changed

Lines changed: 10630 additions & 1006 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/java-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/setup-java@v4
4444
with:
4545
distribution: temurin
46-
java-version: 8
46+
java-version: 11
4747
server-id: ossrh
4848
server-username: SONATYPE_USER
4949
server-password: SONATYPE_TOKEN

.github/workflows/java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
timeout-minutes: 60
5151
strategy:
5252
matrix:
53-
java-version: [ 8, 11, 17 ]
53+
java-version: [ 11, 17 ]
5454
steps:
5555
- name: Install dependencies
5656
run: |

docs/src/spec/rest.yaml

Lines changed: 255 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,6 @@ components:
12661266
type: array
12671267
items:
12681268
type: string
1269-
12701269
version:
12711270
type:
12721271
- integer
@@ -1303,11 +1302,6 @@ components:
13031302
$ref: '#/components/schemas/TableBasicStats'
13041303
table:
13051304
type: string
1306-
table_uri:
1307-
type:
1308-
- string
1309-
- 'null'
1310-
description: Table URI, optional
13111305
version:
13121306
type: integer
13131307
format: int64
@@ -1501,58 +1495,103 @@ components:
15011495
type: array
15021496
items:
15031497
type: string
1504-
vector:
1505-
type: array
1506-
items:
1507-
type: number
1508-
format: float
1509-
description: Query vector for similarity search
1510-
k:
1511-
type: integer
1512-
minimum: 1
1513-
description: Number of results to return
1514-
filter:
1515-
type: string
1516-
description: Optional SQL filter expression
1498+
bypass_vector_index:
1499+
type:
1500+
- boolean
1501+
- 'null'
1502+
description: Whether to bypass vector index
15171503
columns:
15181504
type: array
15191505
items:
15201506
type: string
15211507
description: Optional list of columns to return
15221508
distance_type:
1523-
type: string
1524-
enum: ["l2", "cosine", "dot"]
1509+
type:
1510+
- string
1511+
- 'null'
15251512
description: Distance metric to use
1526-
prefilter:
1527-
type: boolean
1528-
description: Whether to apply filtering before vector search
1529-
bypass_vector_index:
1530-
type: boolean
1531-
description: Whether to bypass vector index
15321513
ef:
1533-
type: integer
1534-
minimum: 1
1514+
type:
1515+
- integer
1516+
- 'null'
1517+
minimum: 0
15351518
description: Search effort parameter for HNSW index
1536-
nprobes:
1519+
fast_search:
1520+
type:
1521+
- boolean
1522+
- 'null'
1523+
description: Whether to use fast search
1524+
filter:
1525+
type:
1526+
- string
1527+
- 'null'
1528+
description: Optional SQL filter expression
1529+
full_text_query:
1530+
$ref: '#/components/schemas/StringFtsQuery'
1531+
description: Optional full-text search query (only string query supported)
1532+
k:
15371533
type: integer
1538-
minimum: 1
1534+
minimum: 0
1535+
description: Number of results to return
1536+
lower_bound:
1537+
type:
1538+
- number
1539+
- 'null'
1540+
format: float
1541+
description: Lower bound for search
1542+
nprobes:
1543+
type:
1544+
- integer
1545+
- 'null'
1546+
minimum: 0
15391547
description: Number of probes for IVF index
1540-
refine_factor:
1541-
type: integer
1542-
minimum: 1
1543-
description: Refine factor for search
1544-
with_row_id:
1545-
type: boolean
1546-
description: Whether to include row ID in results
15471548
offset:
1548-
type: integer
1549+
type:
1550+
- integer
1551+
- 'null'
15491552
minimum: 0
15501553
description: Number of results to skip
1554+
prefilter:
1555+
type:
1556+
- boolean
1557+
- 'null'
1558+
description: Whether to apply filtering before vector search
1559+
refine_factor:
1560+
type:
1561+
- integer
1562+
- 'null'
1563+
format: int32
1564+
minimum: 0
1565+
description: Refine factor for search
1566+
upper_bound:
1567+
type:
1568+
- number
1569+
- 'null'
1570+
format: float
1571+
description: Upper bound for search
1572+
vector:
1573+
type: array
1574+
items:
1575+
type: number
1576+
format: float
1577+
description: Query vector for similarity search (single vector only)
1578+
vector_column:
1579+
type:
1580+
- string
1581+
- 'null'
1582+
description: Name of the vector column to search
15511583
version:
1552-
type: integer
1584+
type:
1585+
- integer
1586+
- 'null'
15531587
format: int64
15541588
minimum: 0
15551589
description: Table version to query
1590+
with_row_id:
1591+
type:
1592+
- boolean
1593+
- 'null'
1594+
description: If true, return the row id as a column called `_rowid`
15561595

15571596
CreateIndexRequest:
15581597
type: object
@@ -1788,19 +1827,23 @@ components:
17881827
$ref: '#/components/schemas/JsonDataType'
17891828
JsonDataType:
17901829
type: object
1791-
description: JSON representation of an Apache Arrow [DataType].
1830+
description: JSON representation of an Apache Arrow DataType
17921831
required:
17931832
- type
17941833
properties:
17951834
fields:
1796-
type: object
1835+
type: array
1836+
items:
1837+
$ref: '#/components/schemas/JsonField'
1838+
description: Fields for complex types like Struct, Union, etc.
17971839
length:
1798-
type:
1799-
- integer
1800-
- 'null'
1840+
type: integer
1841+
format: int64
1842+
description: Length for fixed-size types
18011843
minimum: 0
18021844
type:
18031845
type: string
1846+
description: The data type name
18041847

18051848
Binary:
18061849
type: string
@@ -2040,6 +2083,173 @@ components:
20402083
type: integer
20412084
minimum: 0
20422085

2086+
2087+
StringFtsQuery:
2088+
type: object
2089+
required:
2090+
- query
2091+
properties:
2092+
columns:
2093+
type:
2094+
- array
2095+
- 'null'
2096+
items:
2097+
type: string
2098+
query:
2099+
type: string
2100+
2101+
StructuredFtsQuery:
2102+
type: object
2103+
required:
2104+
- query
2105+
properties:
2106+
query:
2107+
$ref: '#/components/schemas/FtsQuery'
2108+
2109+
FtsQuery:
2110+
oneOf:
2111+
- type: object
2112+
required:
2113+
- match
2114+
properties:
2115+
match:
2116+
$ref: '#/components/schemas/MatchQuery'
2117+
- type: object
2118+
required:
2119+
- phrase
2120+
properties:
2121+
phrase:
2122+
$ref: '#/components/schemas/PhraseQuery'
2123+
- type: object
2124+
required:
2125+
- boost
2126+
properties:
2127+
boost:
2128+
$ref: '#/components/schemas/BoostQuery'
2129+
- type: object
2130+
required:
2131+
- multi_match
2132+
properties:
2133+
multi_match:
2134+
$ref: '#/components/schemas/MultiMatchQuery'
2135+
- type: object
2136+
required:
2137+
- boolean
2138+
properties:
2139+
boolean:
2140+
$ref: '#/components/schemas/BooleanQuery'
2141+
2142+
MatchQuery:
2143+
type: object
2144+
required:
2145+
- terms
2146+
properties:
2147+
boost:
2148+
type: number
2149+
format: float
2150+
column:
2151+
type:
2152+
- string
2153+
- 'null'
2154+
fuzziness:
2155+
type:
2156+
- integer
2157+
- 'null'
2158+
format: int32
2159+
minimum: 0
2160+
max_expansions:
2161+
type: integer
2162+
description: |-
2163+
The maximum number of terms to expand for fuzzy matching.
2164+
Default to 50.
2165+
minimum: 0
2166+
operator:
2167+
$ref: '#/components/schemas/Operator'
2168+
description: |-
2169+
The operator to use for combining terms.
2170+
This can be either `And` or `Or`, it's 'Or' by default.
2171+
- `And`: All terms must match.
2172+
- `Or`: At least one term must match.
2173+
prefix_length:
2174+
type: integer
2175+
format: int32
2176+
description: |-
2177+
The number of beginning characters being unchanged for fuzzy matching.
2178+
Default to 0.
2179+
minimum: 0
2180+
terms:
2181+
type: string
2182+
2183+
PhraseQuery:
2184+
type: object
2185+
required:
2186+
- terms
2187+
properties:
2188+
column:
2189+
type:
2190+
- string
2191+
- 'null'
2192+
slop:
2193+
type: integer
2194+
format: int32
2195+
minimum: 0
2196+
terms:
2197+
type: string
2198+
2199+
BoostQuery:
2200+
type: object
2201+
required:
2202+
- positive
2203+
- negative
2204+
properties:
2205+
negative:
2206+
type: object
2207+
negative_boost:
2208+
type: number
2209+
format: float
2210+
positive:
2211+
type: object
2212+
2213+
MultiMatchQuery:
2214+
type: object
2215+
required:
2216+
- match_queries
2217+
properties:
2218+
match_queries:
2219+
type: array
2220+
items:
2221+
$ref: '#/components/schemas/MatchQuery'
2222+
2223+
BooleanQuery:
2224+
type: object
2225+
description: Boolean query with must, should, and must_not clauses
2226+
required:
2227+
- should
2228+
- must
2229+
- must_not
2230+
properties:
2231+
must:
2232+
type: array
2233+
items:
2234+
$ref: '#/components/schemas/FtsQuery'
2235+
description: Queries that must match (AND)
2236+
must_not:
2237+
type: array
2238+
items:
2239+
$ref: '#/components/schemas/FtsQuery'
2240+
description: Queries that must not match (NOT)
2241+
should:
2242+
type: array
2243+
items:
2244+
$ref: '#/components/schemas/FtsQuery'
2245+
description: Queries that should match (OR)
2246+
2247+
Operator:
2248+
type: string
2249+
enum:
2250+
- And
2251+
- Or
2252+
20432253
responses:
20442254
ListNamespacesResponse:
20452255
description: A list of namespaces

0 commit comments

Comments
 (0)